docs(server-mode): plan moved in from the deleted AgentHub-Server repo; P6 spike result; Express patch only on 4.x

- docs/plans/server-mode/README.md: the original multi-user design, now kept
  here (AgentHub is the one source); desktop-parity and S3-PLAN link to it.
- S3-PLAN P6: managed-settings spike run on agh-test1 — the managed
  marketplace/plugin arrive at the first interactive session (onboarding
  seeded), never via the CLI alone, and no user-scope record is written.
- server/index.js: the Layer.handle_request patch applies only on Express 4
  (Express 5 handles async rejections itself and has no lib/router/layer).
This commit is contained in:
2026-10-09 15:18:57 +07:00
parent 84e2a9f0ac
commit 118eaee2ec
4 changed files with 111 additions and 6 deletions
+3 -2
View File
@@ -58,8 +58,9 @@ const express = require("express");
// throw after the first await) became an unhandled rejection, and Node exits
// on one — any request that made a handler throw took the whole server down.
// Every handler's rejection goes to `next(err)` (a 500) instead, the way a
// synchronous throw already did. Express 5 does this itself.
{
// synchronous throw already did. Express 5 does this itself, and has no
// `lib/router/layer` to patch — so only a 4.x gets it.
if (require("express/package.json").version.split(".")[0] === "4") {
const Layer = require("express/lib/router/layer");
Layer.prototype.handle_request = function handle(req, res, next) {
const fn = this.handle;