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 — bin proxies: per-key serialization chain maps never delete settled entries — claude-code (chains), muse (warmChains) and commandcode (acp.locks) leak one entry per conversation, and per request on the anon/ephemeral paths · Issue #2407 · developing-today/code

bin proxies: per-key serialization chain maps never delete settled entries — claude-code (chains), muse (warmChains) and commandcode (acp.locks) leak one entry per conversation, and per request on the anon/ephemeral paths #2407

New issue
Copy link
New issue
Copy link
Closed
Closed
bin proxies: per-key serialization chain maps never delete settled entries — claude-code (chains), muse (warmChains) and commandcode (acp.locks) leak one entry per conversation, and per request on the anon/ephemeral paths#2407
Copy link
Assignees
dezren39
Labels
app/claude-code-proxybin/claude-code-proxy.mjsapp/commandcode-proxybin/commandcode-proxy.mjs fleet proxyapp/muse-proxybin/muse-proxy.mjs OpenAI-compatible Muse bridgeeffort/xsTrivial: expected under 30 minutes of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/lowNice to have; do when convenientsource/creatorFiled by the new-issue-creator jobtask/triageQueue packet kind: verify, reproduce, and route this item

Description

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

Problem

Three of the fleet's warm proxies serialize turns per conversation key with a promise-chain Map that is written on every request and never deleted from — not when the chain settles, not on session eviction, not ever. The fourth proxy in the same directory implements the same pattern correctly, which makes the omission visible:

The correct in-tree pattern — bin/agy-proxy.mjs:756-763:

const chains = new Map();
const enqueue = (key, job) => {
  const prev = chains.get(key) || Promise.resolve();
  const run = prev.then(job, job);
  const stored = run.catch(() => {});
  chains.set(key, stored);
  stored.then(() => { if (chains.get(key) === stored) chains.delete(key); }); // <-- self-cleanup
  return run;
};

The three leaking sites:

  1. bin/claude-code-proxy.mjs:489-494 — chains: chains.set(key, run.catch(() => {})) and no chains.delete anywhere in the file. Worse, the request handler mints a brand-new key for every keyless request (const key = getSessionKey(req, body) || \anon:${crypto.randomUUID()}``, :733), so growth is per-request, not per-conversation, for that traffic.
  2. bin/muse-proxy.mjs:656-662 — warmChains: same shape (warmChains.set(key, run.catch(() => {})), no delete). Keys are conversationKey() hashes (system prompt + first user message, :337-344), so every distinct conversation ever served leaves a permanent entry.
  3. bin/commandcode-proxy.mjs — acp.locks (declared :537; set in runChat, :770-777): this.locks.set(lockKey, run.catch(() => {})), no locks.delete anywhere. Sessionless calls use ephemeral: !sessionKey (:1167), and runChat turns those into `ephemeral:${crypto.randomUUID()}` (:770) — again a guaranteed-never-reused key per request.

These proxies are long-lived systemd services, so the maps grow monotonically for the whole process lifetime: one retained settled promise + key string per distinct conversation — and per request on the anon/ephemeral paths. Nothing else bounds them: claude-code-proxy caps live sessions at 32 and sweeps idle sessions (evictIfNeeded), and commandcode/muse have their own session TTLs, but none of those touch the chain maps.

Evidence (verified this run, main 5a34fa70)

Files are md5-identical on sandbox main and the laptop (bin/claude-code-proxy.mjs 7280c4bb…, bin/muse-proxy.mjs 2f87df2e…, bin/commandcode-proxy.mjs a5223632…, bin/agy-proxy.mjs 988ab4c0…).

Deletion-site census over each whole file: claude-code-proxy chains.set ×1 / chains.delete ×0; muse-proxy warmChains.set ×1 / warmChains.delete ×0; commandcode-proxy locks.set ×1 / locks.delete ×0; agy-proxy (control) chains.set ×1 / chains.delete ×1.

Laptop probe (~/git/fleet/probe-2026-10-29-laneB-chainleak/probe.mjs) extracted the verbatim chains/enqueue, warmChains/enqueueWarm, and agy chains/enqueue code from the real files, ran 50 distinct keys with instantly-settling jobs through each, and let cleanup callbacks run:

after 50 distinct keys, all jobs settled:
  claude-code chains.size = 50
  muse warmChains.size    = 50
  agy chains.size (control, self-deleting) = 0
  same-key order sanity: 1,2 ; chains.size now 51

Serialization itself works (same-key jobs run in order) — the entries simply never leave.

Why it matters

A slow, unbounded memory leak in always-on infrastructure: the proxies run for weeks between restarts, and the busiest key spaces (anon/ephemeral, one entry per request) are exactly the ones that can never be reused. Each entry is small, so this will never page anyone — it is the kind of leak that surfaces months later as a proxy holding far more RSS than its session caps suggest, with the cause invisible in the session/TTL accounting that does exist. The fix pattern already exists in-tree (agy) and is three lines per file.

Acceptance criteria

  • All three chain maps remove a key's entry once its chain settles and no newer job has replaced it (the agy pattern: capture the stored promise, stored.then(() => { if (map.get(key) === stored) map.delete(key); })), at: bin/claude-code-proxy.mjs (chains), bin/muse-proxy.mjs (warmChains), bin/commandcode-proxy.mjs (acp.locks in runChat).
  • Serialization semantics are unchanged: two jobs enqueued back-to-back on the same key still run in order and never concurrently, including when a second job is enqueued while the first is still in flight (the delete must only fire for the latest stored promise).
  • A regression test per proxy (the existing *.test.mjs files sit beside each proxy) drives ≥2 distinct keys through the enqueue helper and asserts the map is empty after all jobs settle, plus a same-key ordering assertion.
  • Out of scope: session-store persistence/TTL behaviour (sessions.json, warm store) — bounded separately and unchanged; agy-proxy itself (already correct, it is the reference pattern).

Activity

Next
  1. developing-today commented on Oct 29, 2026

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

    CODE-1228

  2. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    priority/lowNice to have; do when convenient
    queue/queuedHas a queued queue task
    source/creatorFiled by the new-issue-creator job
    task/triageQueue packet kind: verify, reproduce, and route this item
    status/needs-triageNot yet triaged; needs a first look
    app/claude-code-proxybin/claude-code-proxy.mjs
    app/muse-proxybin/muse-proxy.mjs OpenAI-compatible Muse bridge
    app/commandcode-proxybin/commandcode-proxy.mjs fleet proxy
    effort/xsTrivial: expected under 30 minutes of work
    on Oct 29, 2026
  3. dezren39 commented on Oct 29, 2026

    @dezren39
    dezren39
    on Oct 29, 2026
    MemberAuthor
    More actions

    🤖 Agent note · filed

    • Agent: new-issue-creator-code-b (new-issue-creator job, lane B)
    • Session / ID: new-issue-creator-code-b run 2026-10-29 13:50 CDT (18:50 UTC)
    • Found via: filed this run
    • Task: Filed after verifying this run on main 5a34fa7: the per-key serialization chain maps in bin/claude-code-proxy.mjs (chains), bin/muse-proxy.mjs (warmChains) and bin/commandcode-proxy.mjs (acp.locks) are set on every request and never deleted from — one permanent entry per distinct conversation, and per request on the anon:/ephemeral: random-UUID key paths — while bin/agy-proxy.mjs implements the same pattern with self-delete. Laptop probe with the verbatim helpers: 50 distinct settled keys -> sizes 50/50 vs agy control 0.
    • Expectation: effort/xs triage — pin that all three sites adopt the agy self-delete pattern (delete only when the stored promise is still current) and each proxy gains a map-empty-after-settle regression test; then route a small_fix packet.
    • Links: probe ~/git/fleet/probe-2026-10-29-laneB-chainleak/ (laptop); body evidence in the issue.
  4. github-actions
    assigned
    dezren39
    on Oct 29, 2026
  5. dezren39
    removed
    status/needs-triageNot yet triaged; needs a first look
    queue/queuedHas a queued queue task
    on Nov 1, 2026
  6. 10 remaining items

  7. dezren39
    added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    on Nov 2, 2026
  8. dezren39 commented on Nov 2, 2026

    @dezren39
    dezren39
    on Nov 2, 2026
    MemberAuthor
    More actions

    Picked up (task 5277, lane E): implementing the agy-proxy self-delete-on-settle pattern at the three leaking chain maps (claude-code chains, muse warmChains, commandcode acp.locks) plus per-proxy regression tests, per the triage task 3583 pinned sites. Branch: queue/5277-2407-proxy-chain-self-delete.

  9. dezren39
    added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    and removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    on Nov 2, 2026
  10. dezren39 commented on Nov 2, 2026

    @dezren39
    dezren39
    on Nov 2, 2026
    MemberAuthor
    More actions

    PR opened (task 5277): PR #4173 implements the agy self-delete pattern at all three sites (claude-code chains, muse warmChains, commandcode acp.locks) with health-reported map sizes and per-proxy regression tests. Laptop verification: node --test — claude-code 7/7, muse 28/28, commandcode 4/4 pass. CI on PR #4173 has not registered beyond CodeRabbit (NEUTRAL) after a bounded poll (Actions backlog), so task 5277 is parked 20 minutes; resume by rechecking PR #4173 checks, dispositioning any Codex findings, and merging when green.

  11. dezren39
    added a commit that references this issue on Nov 2, 2026

    Merge pull request #4173 from developing-today/queue/5277-2407-proxy-…

    a0e6d1d
  12. dezren39 commented on Nov 2, 2026

    @dezren39
    dezren39
    on Nov 2, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done

    • Agent: queue worker (repo-worker-code), lane C shift
    • Session / ID: task 5277
    • Found via: queue claim (resume of a prior claim that had opened PR fix(proxies): self-delete settled per-key chain entries — claude-code/muse/commandcode (#2407) #4173 and parked on CI)
    • Task: Self-delete settled per-key chain entries (agy pattern) in bin/claude-code-proxy.mjs, bin/muse-proxy.mjs, bin/commandcode-proxy.mjs + regression tests in each proxy's *.test.mjs.
    • Expectation: done — PR fix(proxies): self-delete settled per-key chain entries — claude-code/muse/commandcode (#2407) #4173 MERGED (merge commit a0e6d1d). Verified on resume: diff is exactly the three proxies + three test files with the guarded identity-check self-delete; Codex review clean (no findings); laptop suites passed under the prior claim (7/7 + 28/28 + 4/4). The only failing Actions runs on the branch are the unrelated jules-daily-* scheduled workflows. Closing issue bin proxies: per-key serialization chain maps never delete settled entries — claude-code (chains), muse (warmChains) and commandcode (acp.locks) leak one entry per conversation, and per request on the anon/ephemeral paths #2407 as fixed.
    • Links: PR fix(proxies): self-delete settled per-key chain entries — claude-code/muse/commandcode (#2407) #4173 · branch queue/5277-2407-proxy-chain-self-delete
  13. dezren39
    closed this as completedon Nov 2, 2026
  14. dezren39
    removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    work/assignedQueue worker lifecycle state
    on Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @dezren39
    dezren39

Labels

app/claude-code-proxybin/claude-code-proxy.mjsapp/commandcode-proxybin/commandcode-proxy.mjs fleet proxyapp/muse-proxybin/muse-proxy.mjs OpenAI-compatible Muse bridgeeffort/xsTrivial: expected under 30 minutes of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/lowNice to have; do when convenientsource/creatorFiled by the new-issue-creator jobtask/triageQueue packet kind: verify, reproduce, and route this item

Type

No type

Projects

No projects

    Milestone

    No milestone

    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.