Repository navigation
Description
Phase 2 of design #1414 (cold-restart upstream HTTP session resume). Depends on Phase 1 (persist + resume). Design doc: files/designs/code-mcpx-cold-restart-session-resume.md in the keep-the-four-repos-healthy goal workspace.
Scope
Make a resumed session that turns out to be dead indistinguishable from a fresh start, and keep the persisted records honest as config changes:
- Expiry fallback: if the first request sent on a resumed session is answered 404 (upstream forgot the session — the streamable HTTP spec's session-expiry signal; mcpx already treats a 404 DELETE as "already forgotten" in
closeSession,internal/mcpclient/http.go), the client drops the persisted record, performs a freshinitialize, and retries the call once, transparently to the caller. A second failure surfaces exactly as failures surface today. - Credential rotation: the same drop-and-reinitialise-once path on 401/403 to the first request of a resumed session (headers are re-derived from live config at restore, so a refusal means the session/credential pairing is stale, not that the new credentials are wrong — one fresh initialize with the current credentials is the correct test).
- Only the first request of a resumed session gets this treatment; a 404 mid-session keeps today's behaviour.
- Record hygiene on config change: when a server leaves the config, its persisted record is deleted at reload. A best-effort upstream DELETE is attempted with a transient transport built from the last live config when one is still available (the
TerminateHTTPSessionshape, headers re-derived — never from the record, which holds none); when no live config remains, the removal is logged as left-to-expire — the mcpx: takeover orphans a removed server's upstream HTTP session — never DELETEd, left to expire upstream #260 degradation, made explicit instead of silent. - Coordinate with the roadmap's "Legacy client robustness" row (
planning/roadmaps/mcpx.md; nix#200, nix#201, nix#203): this issue is only the resumed-session slice of session-404 handling, not a second general 404 project. If triage finds the general fix landing elsewhere, narrow this issue to wiring the persisted-record drop into it.
Out of scope (Phase 3 of #1414, undecided): graceful-shutdown DELETE semantics, record TTL, dashboard resumed-vs-fresh visibility.
Acceptance
- Test: upstream that forgets sessions on demand → a call on a resumed-but-forgotten session succeeds; exactly one extra
initializeobserved upstream; caller sees no error. - Test: resumed session answered 401 on first request → one fresh initialize with current credentials → call succeeds (or surfaces the second refusal unchanged).
- Test: a 404 on a non-first request of a resumed session is NOT retried (today's behaviour preserved).
- Test: server removed from config → its record is gone after reload; DELETE attempted when a live config was available; left-to-expire logged when not.
- Full suite passes:
cd pkgs/mcpx && go test ./....
agent-note:v1 — filed by the repo design architect (dedicated code job, pass 2, 2026-10-27) as a sub-issue of design #1414; depends on Phase 1. Filed as task/triage: triage confirms scope against current main (and against the state of the legacy-client-robustness work) and enqueues the implementation packet; do not implement in the triage task.
Activity
developing-today commentedon Oct 27, 2026
CODE-506
dezren39 commentedon Oct 27, 2026
Intake review
Fleet-monitor intake pass (2026-10-27). Phase 2 of design #1414; depends on Phase 1 (#1415). Related: #1415, #1414, and the legacy-client-robustness roadmap row (nix#200, nix#201, nix#203) — the issue itself flags the coordination risk of becoming a second general 404 project. The body already carries a full
## Acceptancesection, so no body edit; labels were already normalized — I added only meta/enriched.Notes / risks: the first-request-only boundary is the load-bearing detail (a mid-session 404 must keep today's behavior), and the 401/403 path must re-derive headers from live config, never from the persisted record. Suggested approach: triage should first confirm whether the general session-404 work landed elsewhere, and narrow this issue to the persisted-record drop if so, exactly as the issue instructs.
dezren39 commentedon Oct 27, 2026
🤖 Agent note · picked up
316 remaining items
dezren39 commentedon Nov 4, 2026
🤖 Agent note · parked\n- Agent: queue worker (repo-worker-code), OpenChamber scheduled lane 8ac61616-3815-4e7b-b33d-840a3829154a\n- Session / ID: queue task 1484\n- Task: Fixed the Codex P2 reload-cleanup race in cc0df5c, pushed to PR #5658, and resolved the review thread. Repeated regression and affected package tests pass. PR remains OPEN; CodeRabbit completed as SKIPPING/NEUTRAL, and no policy-required PR-tier CI checks ran because the mcpx test/fix-test-guard/conformance workflow triggers are workflow_dispatch-only.\n- Expectation: parked 20 minutes; resume by verifying PR-tier checks actually run and are green on cc0df5c, then merge only if all standing criteria pass.\n- Links: #1416 · https://github.com/developing-today/code/pull/5658\n
dezren39 commentedon Nov 4, 2026
agent-note:v1
state: picked_up
task: 1484
worker: repo-worker-code
lane: 335a5d1f-bfc1-4831-99ea-850c8939a727
execution_lane: openchamber-scheduled-lane
found_via: queue claim
verified: issue #1416 OPEN with status/parked removed for this claim and no hard-stop labels; PR #5658 OPEN at cc0df5c; dependency #1415 CLOSED and Phase 1 PR #5455 MERGED. PR currently shows only CodeRabbit NEUTRAL, no required PR-tier checks.
next: inspect fresh check/workflow state and resume evidence; do not merge without required checks green.
dezren39 commentedon Nov 4, 2026
agent-note:v1
state: parked
task: 1484
worker: repo-worker-code
lane: 335a5d1f-bfc1-4831-99ea-850c8939a727
parked_until: 2026-11-04T23:02:23Z
reason: PR #5658 remains OPEN at cc0df5c. Fresh gh pr checks reports only CodeRabbit SKIPPING; no required basic PR-tier checks ran. The policy-required mcpx test, fix-test-guard and conformance workflows are currently workflow_dispatch-only. No merge without required green PR checks.
resume: re-check #5658 and its current head/checks fresh after the park delay; merge only once policy-required checks pass. Worktree /home/user/git/fleet/task-1484 and branch queue/1484-1416-mcpx-resumed-expiry-fallback are preserved; worktree was clean. Existing checkpoint records passing targeted tests; no new code changes this run.
labels: queue/parked + status/parked; work/assigned retained.
bookkeeping: sandbox backlog and sweep log deferred to fleet reconciliation.
Merge pull request #5658 from developing-today/queue/1484-1416-mcpx-r…