GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — design(mcpx): resume upstream HTTP sessions after a cold restart — persist the resumable session state · Issue #1414 · developing-today/code

design(mcpx): resume upstream HTTP sessions after a cold restart — persist the resumable session state #1414

New issue
Copy link
New issue
Copy link
Done
2 / 22 of 2 issues completed
Done
design(mcpx): resume upstream HTTP sessions after a cold restart — persist the resumable session state#1414
2 / 22 of 2 issues completed
Copy link
Labels
app/mcpxPackage/app: mcpx (pkgs/ or apps/ in this repo)effort/lLarge: multi-day or open-ended; expect staged check-insepicMeta-issue grouping multiple items (org Project Type=Epic)epic/mcpx-platformReprioritization program epic (2026-11-12)kind/designA design proposal (design-architect): multi-step, phased, decision-bearingmeta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/normalOrdinary priority (the default)source/design-architectFiled by the repo design architect jobtask/triageQueue packet kind: verify, reproduce, and route this item
Milestone
mcpx platform program

Description

@dezren39
dezren39
opened on Oct 27, 2026
Issue body actions

Decision for Drew (one line): Approve persisting mcpx upstream HTTP session state (session IDs + protocol state, never resolved header secrets) to the owner-only state dir so a cold restart resumes sessions instead of re-initialising every HTTP upstream — yes/no; the graceful-shutdown DELETE question in Phase 3 rides on the same decision.

Design doc: files/designs/code-mcpx-cold-restart-session-resume.md in the keep-the-four-repos-healthy goal workspace. Register: central potential-projects list, same workspace (files/potential-projects.md).

Summary

A takeover preserves upstream HTTP sessions; a cold restart does not. pkgs/mcpx/TODO.md item 3: "The lease table is restored from sessions.json, but the upstream Mcp-Session-Id is kept only in memory and in the takeover handoff, so after a restart each HTTP upstream is initialised again." Roadmap: planning/roadmaps/mcpx.md → Next → "Resume upstream sessions after a cold restart" (status idea).

Costs per cold restart, per HTTP upstream: a fresh initialize handshake, silent loss of upstream per-session state, and one leaked upstream session (the dead daemon never sent DELETE; the new daemon doesn't know the ID — #260 fixed this leak for takeover only).

Proposal: persist the resumable half of each legacy streamable-HTTP upstream session in a new versioned state-dir file (same discipline as internal/daemon/sessions.go: atomic tmp+rename, defaults.PrivateMode, version envelope, ignore-on-mismatch), and let a cold-started daemon take the existing takeover restore path with the record standing in for the socket:

  • Record per pool instance: instance key, URL, config fingerprint (hash over session-defining config fields + header/auth names, never values), HTTPHandoff minus Headers (SessionID, Negotiated), the full mcpclient.Session protocol state, savedAt.
  • No resolved header values on disk — the codebase's rule is that handoff headers travel "over the takeover's unix socket only" (internal/mcpclient/http.go, HTTPHandoff comment). On restore, headers are re-derived from live config (httpOptions() + resolveAuth()), then the transport/client are seeded with the exact calls takeover makes: ht.Resume(...) and mcpclient.Resume(...) (internal/pool/handoff.go:238,326). No parallel resume implementation.
  • Save on legacy session establishment and on session-ID change (internal/mcpclient/http.go:156 is where IDs are adopted); save failure is logged, non-fatal — resume is an optimisation.
  • Scope: legacy-era streamable HTTP only. Modern era (2026-07-28) has no sessions; legacy SSE holds its session in the GET stream (TODO item 2 already accepts re-init there).

Grounding: internal/mcpclient/http.go (sessionID/negotiated in memory only), internal/mcpclient/handoff.go (SessionState(), Resume — the no-handshake client already exists), internal/pool/pool.go:704 (dial() seeds nothing today), internal/daemon/sessions.go (persistence precedent). Sibling of #1384 (stdio supervisor), which names cold-restart HTTP resume as an explicit non-goal — this design is that non-goal, designed separately. Alternatives (do nothing; fold into sessions.json; persist full handoff incl. headers; era-cache-only) and risks (stale-session resume, session IDs as bearer tokens on disk, write amplification, restore-path drift) are argued in the design doc.

Phased breakdown

  • Phase 1 — persist and resume. New state file + record type; fingerprint gate; restore via the takeover path. Defining test: session established → daemon SIGKILLed → restarted → first call succeeds, upstream saw no second initialize, request carried the original Mcp-Session-Id. Filed as a sub-issue of this issue.
  • Phase 2 — expiry fallback and record hygiene. First request on a resumed session answered 404 (or 401/403 after credential rotation) → drop record, fresh initialize, retry once, transparently. Server removed from config → record deleted + best-effort upstream DELETE, or logged left-to-expire (the mcpx: takeover orphans a removed server's upstream HTTP session — never DELETEd, left to expire upstream #260 degradation, made explicit). Coordinate with the roadmap's "Legacy client robustness" row (nix#200–Update module golang.org/x/net to v0.55.0 [SECURITY] #203) — this is only the resumed-session slice. Filed as a sub-issue of this issue.
  • Phase 3 — open questions, NOT filed. Graceful-shutdown semantics (should a restart-intent stop skip the DELETE that Close → closeSession sends today?); record TTL; dashboard resumed-vs-fresh visibility; whether takeover should also write the record. The shutdown question is part of Drew's decision above.

agent-note:v1 — filed by the repo design architect (dedicated code job, pass 2, 2026-10-27). Design doc + register entry as linked above. user/review carries the one-line direction decision at the top; Phases 1–2 are filed as sub-issues with queue/queued + task/triage packets enqueued to repo-health-code-pilot; Phase 3 stays as questions in the design doc.

Acceptance criteria

  • Drew's decision on persisting upstream HTTP session state (IDs + protocol state only, never resolved header secrets) is recorded on this issue.
  • If approved: Phase 1 (mcpx: Phase 1 of #1414 — persist legacy HTTP upstream sessions and resume them after a cold restart #1415) and Phase 2 (mcpx: Phase 2 of #1414 — resumed-session expiry fallback (404/401) and record hygiene #1416) land with their own acceptance criteria met, and the Phase 3 graceful-shutdown DELETE question is answered in the same decision thread.
  • If declined: this issue and its phases are closed with the rationale recorded, and pkgs/mcpx/TODO.md item 3 is updated to match.

Sub-issues

Collapse Sub-issuesSub-issues

2 of 22 of 2 Issues completed
Loading 2 sub-issues

Activity

Next
  1. dezren39
    added
    status/needs-triageNot yet triaged; needs a first look
    user/reviewNeeds a user-look: Muse reviews first and handles what it can
    priority/normalOrdinary priority (the default)
    app/mcpxPackage/app: mcpx (pkgs/ or apps/ in this repo)
    epicMeta-issue grouping multiple items (org Project Type=Epic)
    effort/lLarge: multi-day or open-ended; expect staged check-ins
    kind/designA design proposal (design-architect): multi-step, phased, decision-bearing
    on Oct 27, 2026
  2. developing-today commented on Oct 27, 2026

    @developing-today
    developing-todayBot
    on Oct 27, 2026 – with developing.today
    Contributor
    More actions

    CODE-504

  3. dezren39
    added
    source/design-architectFiled by the repo design architect job
    on Oct 27, 2026
  4. github-actions
    assigned
    dezren39
    on Oct 27, 2026
  5. dezren39
    added sub-issues on Oct 27, 2026
    • mcpx: Phase 1 of #1414 — persist legacy HTTP upstream sessions and resume them after a cold restart #1415
    • mcpx: Phase 2 of #1414 — resumed-session expiry fallback (404/401) and record hygiene #1416
  6. dezren39
    added
    meta/enrichedIntake review done: acceptance criteria, links, and normalized labels added
    on Oct 27, 2026
  7. dezren39 commented on Oct 27, 2026

    @dezren39
    dezren39
    on Oct 27, 2026
    MemberAuthor
    More actions

    Intake review

    Fleet monitor intake pass, 2026-10-27 (repo-fleet-monitor).

    Related: implementation phases already filed — #1415 (Phase 1: persist + resume legacy HTTP sessions) and #1416 (Phase 2: expiry fallback + record hygiene), both enriched earlier today and queued. Design doc: files/designs/code-mcpx-cold-restart-session-resume.md in the goal workspace.

    Notes: This is the decision parent, not a work item: it already carries priority/normal, effort/l, kind/design and user/review. The one-line decision in the body (persist session state — yes/no) is genuinely Drew's, so the phases stay queued behind it.

    Risks: Persisting anything beyond session IDs + protocol state would be a secrets bug — the acceptance criteria restate the never-secrets boundary.

    Suggested approach: Drew decides on this issue; on a yes, #1415 is the first claimable step.

  8. dezren39 commented on Oct 28, 2026

    @dezren39
    dezren39
    on Oct 28, 2026
    MemberAuthor
    More actions

    agent-note:v1 — escalated to user (worker-first review attached)

    • task: 1483 implementation of mcpx: Phase 1 of #1414 — persist legacy HTTP upstream sessions and resume them after a cold restart #1415 (lane A shift, 2026-10-28)
    • review: I reviewed design design(mcpx): resume upstream HTTP sessions after a cold restart — persist the resumable session state #1414 as the worker-first reviewer before implementing mcpx: Phase 1 of #1414 — persist legacy HTTP upstream sessions and resume them after a cold restart #1415. The design is technically landable as scoped (triage task 1409 verified every reused building block on main: SessionState/Resume in mcpclient, the takeover restore calls in pool/handoff.go, the sessions.go persistence discipline), and the security invariant is structural: the record type has NO field for headers or resolved secret values, the file is owner-only (defaults.PrivateMode), and headers are re-derived from live config on restore.
    • why this is still yours: the one-line decision in this issue — persist upstream session IDs (which act as bearer credentials) to disk at all — is a security posture call the fleet monitor's intake review (2026-10-27) already identified as genuinely Drew's, and Phase 1 must not be implemented against an undecided design. My read: the mitigations above make "yes" defensible; the residual risk is that a stolen state-dir file yields resumable session IDs until the upstreams expire them (Phase 2's 404/401 fallback bounds, but does not erase, that).
    • action needed: yes/no on this issue. On yes, task 1483 unblocks and mcpx: Phase 1 of #1414 — persist legacy HTTP upstream sessions and resume them after a cold restart #1415 is the first claimable step (it also gates mcpx: Phase 2 of #1414 — resumed-session expiry fallback (404/401) and record hygiene #1416 / task 1484). On no, mcpx: Phase 1 of #1414 — persist legacy HTTP upstream sessions and resume them after a cold restart #1415/mcpx: Phase 2 of #1414 — resumed-session expiry fallback (404/401) and record hygiene #1416 should be closed as declined.
    • state: task 1483 blocked (escalated-to-user); this issue swapped user/review -> user/escalated.
  9. 96 remaining items

  10. dezren39 commented on Nov 16, 2026

    @dezren39
    dezren39
    on Nov 16, 2026
    MemberAuthor
    More actions

    Agent note — task 17432 picked up, resuming at PR stage (lane code-a)

    • state: picked-up (resume, §10 resume-don't-restart)
    • task: 17432 · issue: design(mcpx): resume upstream HTTP sessions after a cold restart — persist the resumable session state #1414 · kind: small_fix (mcpx Phase 3, ruling shutdown-delete-1414)
    • Prior lanes' work verified fresh this shift: branch queue/17432-1414-mcpx-restart-skip-delete at b05c2d8, PR fix(mcpx): restart-intent shutdown keeps upstream HTTP sessions (#1414) #10755 OPEN and MERGEABLE, diff scoped to pkgs/mcpx (daemon registry/server, mcpclient client/http + tests, pool + tests). PR body and lane any-n note record go test ./internal/mcpclient ./internal/pool ./internal/daemon passing, including both new restart-intent and explicit-end tests.
    • Codex gate: the Codex review on PR fix(mcpx): restart-intent shutdown keeps upstream HTTP sessions (#1414) #10755 failed on usage limits with zero inline findings (summary metadata only, same failure mode recorded by earlier lanes) — no actionable finding to disposition; merging under standing criteria.
    • Next: merge PR fix(mcpx): restart-intent shutdown keeps upstream HTTP sessions (#1414) #10755, then complete task 17432 and sync labels.
  11. dezren39
    added
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    queue/queuedHas a queued queue task
    on Nov 16, 2026
  12. dezren39
    added a commit that references this issue on Nov 16, 2026

    Merge pull request #10755 from developing-today/queue/17432-1414-mcpx…

    db37118
  13. dezren39 commented on Nov 16, 2026

    @dezren39
    dezren39
    on Nov 16, 2026
    MemberAuthor
    More actions

    Agent note — task 17432 done, fixed_merged (lane code-a)

    • PR fix(mcpx): restart-intent shutdown keeps upstream HTTP sessions (#1414) #10755 MERGED — merge commit db37118 (verified fresh after merge).
    • Outcome: restart-intent graceful shutdown now skips the upstream DELETE and keeps the persisted mcpx session resumable; explicit session end still sends DELETE (ruling shutdown-delete-1414). Tests recorded on the PR: transport-level both paths + pool-level end-to-end, go test ./internal/mcpclient ./internal/pool ./internal/daemon passing.
    • Codex gate: review failed on usage limits, zero inline findings — no actionable finding; merged under standing criteria (noted on the pickup note).
    • Issue design(mcpx): resume upstream HTTP sessions after a cold restart — persist the resumable session state #1414 is an epic and stays OPEN per the program-tending convention on this issue (epic closure is left to a person); this task's Phase 3 implementation — the last unimplemented phase — is landed.
    • Queue: task 17432 completed fixed_merged by lane code-a; claim/park labels cleared in the same pass.
  14. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 16, 2026
  15. dezren39
    removed their assignment
    on Nov 20, 2026
  16. dezren39 commented on Nov 22, 2026

    @dezren39
    dezren39
    on Nov 22, 2026 – with Claude
    MemberAuthor
    More actions

    Merged work, still open. Every pull request that references this issue has merged (#1426, #5455, #5036, #5517, #5559, #5658) and none is open, but the issue kept status:in-review. Tasks that name it as a blocker have been waiting on it.

    status:in-review is removed. Whoever takes this next: run the issue's done check against main. Close the issue if it passes; if not, list what is left here and carry on with it (AGENTS.md, "Finishing work").

    By: Claude, 2026-11-22 flow review.


    Generated by Claude Code

  17. dezren39
    removed
    status:in-review
    on Nov 22, 2026
  18. dezren39 commented on Nov 25, 2026

    @dezren39
    dezren39
    on Nov 25, 2026 – with Claude
    MemberAuthor
    More actions

    Closing as completed. All three acceptance items are met:

    • Drew's decision is recorded here: on 2026-10-28 he said YES to persisting the session ID and protocol state, never resolved headers.
    • Both phases landed: Phase 1 mcpx: Phase 1 of #1414 — persist legacy HTTP upstream sessions and resume them after a cold restart #1415 (PR feat(mcpx): persist legacy HTTP upstream sessions across a cold restart (#1415) #5455) and Phase 2 mcpx: Phase 2 of #1414 — resumed-session expiry fallback (404/401) and record hygiene #1416 (PR mcpx: recover resumed HTTP sessions and clean removed servers (#1416) #5658) are closed and merged.
    • The Phase 3 graceful-shutdown DELETE question is answered in this thread: ruling shutdown-delete-1414 (2026-11-15) skips the upstream DELETE on a restart-intent shutdown and sends it only when a session is explicitly ended. That is implemented in PR fix(mcpx): restart-intent shutdown keeps upstream HTTP sessions (#1414) #10755, merged 2026-11-16.

    pkgs/mcpx/TODO.md was updated with the landed phases in the 2026-11-08 small fix. Reopen this issue if anything is still owed.


    Generated by Claude Code

  19. dezren39
    closed this as completedon Nov 25, 2026
  20. developing-today-fleet
    added a commit that references this issue on Nov 26, 2026

    Merge main into docs/roadmap-tending-2026-11-26

    c071ab5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/mcpxPackage/app: mcpx (pkgs/ or apps/ in this repo)effort/lLarge: multi-day or open-ended; expect staged check-insepicMeta-issue grouping multiple items (org Project Type=Epic)epic/mcpx-platformReprioritization program epic (2026-11-12)kind/designA design proposal (design-architect): multi-step, phased, decision-bearingmeta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/normalOrdinary priority (the default)source/design-architectFiled by the repo design architect jobtask/triageQueue packet kind: verify, reproduce, and route this item

    Type

    No type

    Projects

    No projects

      Milestone

      • mcpx platform programNo due date

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.