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 — opencode-claimant: cap and supervision read GET /api/session, which truncates at 50 — active roots undercounted, live bound sessions reported gone · Issue #4757 · developing-today/code

opencode-claimant: cap and supervision read GET /api/session, which truncates at 50 — active roots undercounted, live bound sessions reported gone #4757

New issue
Copy link
New issue
Copy link
Closed
#6756
Closed
opencode-claimant: cap and supervision read GET /api/session, which truncates at 50 — active roots undercounted, live bound sessions reported gone#4757
#6756
Copy link
Assignees
dezren39
Labels
app/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)meta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/highImportant and time-sensitivesource/design-architectFiled by the repo design architect jobsource/queue-workerFiled or worked by the queue/worker pilottask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Description

@dezren39
dezren39
opened on Nov 3, 2026
Issue body actions

Summary

pm-stack/opencode-claimant/poll.py reads GET /api/session once and treats the reply as the complete session list. That endpoint truncates at 50 entries (ordered by update), so the claimant both undercounts the concurrency cap — it can launch past CAP = 12 — and reports live bound sessions as missing, which the launch rules say must never happen.

Observed 2026-11-03T04:42Z on the laptop server (http://127.0.0.1:13420):

  • GET /api/session → exactly 50 sessions, 50 roots.
  • Tasks 6687 (ses_e5e60c36744ffeUY2rSsCrjMoj), 6639 (ses_e5e613367a0ffe3AfMkKP2LOjB), 6722 (ses_e5e60bd3d74ffewwDg1Qd0n2Qa), 4876 (ses_e5e61a3c885ffeJ9P4DjRpBFVy) — all bound in progress.session_id, all absent from that list — all four return 200 from GET /api/session/<id>.

Impact

  1. Cap overcount of room. summarize_cap() (poll.py:112-128) intersects the 50-row page with /api/session/active. Any active root outside the page is invisible, so active_root_sessions is understated and cap_room overstated. A fire could then launch into a saturated fleet, breaking the one hard rule that is purely about not overloading the host.
  2. False "session is gone". Supervision (claimant instructions step 1) says to check a bound session "still exists / is progressing via GET /api/session". On the truncated page an alive session reads as gone. The relaunch rule is "never relaunch over a live session"; a list-based check turns that into a duplicate-PR class defect waiting to happen.

Proposed fix

  • Count actives from /api/session/active directly (its id set is authoritative and small) rather than filtering a page of /api/session; if root-ness is still needed, fetch each active id with GET /api/session/<id>.
  • Supervision existence must be a per-id GET /api/session/<id>, never membership in the list.
  • If a page is genuinely needed, paginate or pass a large limit and fail closed (cap_room: null) when the returned row count equals the page size — the same fail-closed rule the claimant already applies to an unreadable list.

Evidence trail

Fire log lines for 2026-11-03 in ~/.local/state/opencode-claimant/fires.jsonl carry the full supervision table for that fire.

Acceptance criteria

  • Cap accounting counts active roots from /api/session/active directly (per-id GET for root-ness if needed); summarize_cap() no longer intersects a truncated /api/session page.
  • Supervision existence checks for a bound session use GET /api/session/, never membership in the list endpoint.
  • If any list read remains, it paginates or fails closed (cap_room: null) when the returned count equals the page size.
  • A regression test or fire-log evidence shows correct cap accounting with >50 sessions on the server.

Activity

Next
  1. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    source/queue-workerFiled or worked by the queue/worker pilot
    priority/highImportant and time-sensitive
    app/pm-stackpm-stack (Pad/Grist) in developing-today/code
    status/needs-triageNot yet triaged; needs a first look
    effort/sSmall: expected under 2 hours of work
    meta/enrichedIntake review done: acceptance criteria, links, and normalized labels added
    on Nov 3, 2026
  2. dezren39 commented on Nov 3, 2026

    @dezren39
    dezren39
    on Nov 3, 2026
    MemberAuthor
    More actions

    Intake review

    Evidence in the issue: exactly 50 sessions returned while four bound sessions (tasks 6687, 6639, 6722, 4876) were absent from the list yet returned 200 per-id. Sibling defect: #4758 (same claimant, same morning). Still live at intake: no merged PR references this issue (verified this run). Risks: this is the fleet's host-overload guard — undercounting actives can launch into a saturated laptop. Suggested approach: patch poll.py per the issue's proposed fix (active-set counting + per-id existence), which is small and localized.

    — fleet monitor intake (repo-fleet-monitor, 2026-11-03)

  3. github-actions
    assigned
    dezren39
    on Nov 3, 2026
  4. dezren39 commented on Nov 3, 2026

    @dezren39
    dezren39
    on Nov 3, 2026
    MemberAuthor
    More actions

    Fresh evidence from the 2026-11-03T13:03Z claimant fire (live mode, cap closed the launch gate, nothing launched):

    • GET /api/session → exactly 50 rows again. GET /api/session?limit=100 → 100, ?limit=200 → 200, so the default page is the cap, not the session count.
    • Six bound ids are claimed + progress.lane=opencode + progress.session_id (tasks 1930, 4858, 4876, 5697, 5893, 6418) and all six were absent from the 50-row page while each returned 200 from GET /api/session/<id>, time.idle set and outcome=succeeded. A list-membership existence check would have called six live-but-terminal sessions "gone" and, once their leases expired, made them eligible for a relaunch.
    • Cap count: poll.py's page-based read reported 18 active roots; the per-id count from /api/session/active (fetch each id, keep non-child roots) reported 20. Undercount confirmed in the direction the issue predicts. Both are ≥ CAP = 12, so this fire's decision (launch nothing) was unaffected — the risk is real but did not bite this time.

    Supervision this fire already used per-id GET /api/session/<id> for existence, per the proposed fix; poll.py still needs the summarize_cap() change (active ids from /api/session/active, root-ness per-id) and the fail-closed page-size check.

    Full fire line: ~/.local/state/opencode-claimant/fires.jsonl at 2026-11-03T13:03:29Z.

  5. dezren39
    added a parent issue on Nov 3, 2026
    • design: judge a session by its own record — the opencode-claimant's session contract (per-id reads, verified create, every bound state dispositioned) #4912
  6. dezren39
    added
    source/design-architectFiled by the repo design architect job
    on Nov 3, 2026
  7. dezren39 commented on Nov 3, 2026

    @dezren39
    dezren39
    on Nov 3, 2026
    MemberAuthor
    More actions

    Adopted as Phase 1 of design #4912 (judge a session by its own record — the opencode-claimant's session contract), filed by the fleet design architect, pass 44 (2026-11-03). Design doc: files/designs/code-claimant-session-contract.md in the keep-the-four-repos-healthy goal workspace.

    Phase structure for triage: do NOT re-file, re-scope, or split this issue — it is the phase. Its acceptance stands as written and is decision 1 of the design (cap from the /api/session/active id set with per-id root checks; supervision per-id; any remaining list read fails closed at page-size equality — the same treatment summarize_cap already gives an unreadable active set). Phases 2 (#4870) and 3 (#4758) are independent; Phase 4 (#4916, closing audit) is gated on all three.

    agent-note:v1 — design-architect adoption note, pass 44.

  8. dezren39
    added
    queue/queuedHas a queued queue task
    task/triageQueue packet kind: verify, reproduce, and route this item
    on Nov 3, 2026
  9. 54 remaining items

  10. dezren39 commented on Nov 7, 2026

    @dezren39
    dezren39
    on Nov 7, 2026
    MemberAuthor
    More actions

    Released by repo-worker-code-w (Lane W, fallback mode) — outcome: done (triage work landed). Verdict CONFIRMED with a live server probe (default /api/session page is exactly 50 while ?limit=1000 returns 1000); fix routed on this same issue as task/small-fix + status/triaged + queue/queued, including the fetch-layer pagination/fail-closed design and claimant.py's broken supervision list invocation found during triage.

  11. dezren39 commented on Nov 7, 2026

    @dezren39
    dezren39
    on Nov 7, 2026
    MemberAuthor
    More actions

    Picked up by repo-worker-code-w (Lane W, fallback mode — queue backend down; fallback marker protocol run manually via gh per doc/fleet/queue-fallback-mode.md).

    🤖 Agent note · picked up (fix)

    • Agent: repo-queue-worker Lane W (code-w), fallback mode
    • Task: opencode-claimant: cap and supervision read GET /api/session, which truncates at 50 — active roots undercounted, live bound sessions reported gone #4757 (issue is the task in fallback mode; task/small-fix, priority/high)
    • Stage: claimed — implementing the routed fix from my triage this shift: paginating fetch_sessions with fail-closed completeness in poll.py (+ fetch-layer tests), and claimant.py supervision's list invocation/row-shape correction
  12. dezren39
    added
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    queue/queuedHas a queued queue task
    on Nov 7, 2026
  13. developing-today commented on Nov 7, 2026

    @developing-today
    developing-todayBot
    on Nov 7, 2026 – with developing.today
    Contributor
    More actions

    🤖 Agent note · implementation_complete / targeted_tests_passed

    • Agent: repo-queue-worker Lane W (code-w), fallback mode
    • Task: opencode-claimant: cap and supervision read GET /api/session, which truncates at 50 — active roots undercounted, live bound sessions reported gone #4757 (task/small-fix, priority/high)
    • Stage: fix on branch queue/fallback-4757-session-pagination — fetch_sessions escalates limit (1000 → 10000 → 100000) until a read returns below its limit; claimant supervision list invocation corrected
    • Design correction from live probing: the server honours limit but NOT offset (an offset page repeats page 1 — caught by a non-advancement guard in the first implementation, which correctly failed closed to None); the escalating-limit read replaces offset pagination
    • Live verification: fetch_sessions returns the complete 9,601 sessions in 0.4s; true counts are 7,583 live roots / 15 active / cap_room 21 (the truncated page reported ~50 live roots)
    • Tests: 41/41 in test_poll.py (36 pinned untouched + 5 new fetch-layer tests)
    • Next: PR, Codex disposition, merge under the standing criteria
  14. dezren39
    added a commit that references this issue on Nov 7, 2026

    Merge pull request #6756 from developing-today/queue/fallback-4757-se…

    f235cef
  15. dezren39
    closed this as completedin #6756on Nov 7, 2026
  16. developing-today commented on Nov 7, 2026

    @developing-today
    developing-todayBot
    on Nov 7, 2026 – with developing.today
    Contributor
    More actions

    Released by repo-worker-code-w (Lane W, fallback mode) — outcome: done. Fix landed: PR #6756 merged (merge commit f235cef; verified on origin/main). This issue auto-closed via the PR's Fixes link.

    🤖 Agent note · done

    • Agent: repo-queue-worker Lane W (code-w), fallback mode
    • Task: opencode-claimant: cap and supervision read GET /api/session, which truncates at 50 — active roots undercounted, live bound sessions reported gone #4757 (task/small-fix, priority/high) — outcome: fixed_merged (triage + fix both this shift)
    • What landed: fetch_sessions() proves completeness via escalating-limit reads (offset is not honoured by the server — verified live); claimant supervision's list invocation corrected to the deployed binary's surface with rich-row reads
    • Verification: test_poll.py 41/41 (36 pinned untouched + 5 new fetch-layer tests); live fetch returns all 9,601 sessions, summarize_cap 7,583 live / 15 active / room 21
    • Codex/CI note: PR fix(pm-stack): claimant session fetch must prove completeness — escalating limit, fail closed (#4757) #6756 was created via the developing.today App (user token was secondary-rate-limited); Codex does not engage on App-created PRs (an explicit @codex review request via the App got a connect-account reply), so there are no Codex findings to disposition on this PR. PR CI was still pending at merge (slow infra); merged under the standing merge authority with the change verified live and by the suite on the laptop
  17. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    status/triagedTriaged and routed (see agent note)
    on Nov 7, 2026
  18. dezren39 commented on Nov 10, 2026

    @dezren39
    dezren39
    on Nov 10, 2026
    MemberAuthor
    More actions

    state: phase-4-audit
    task: 13022
    lane: code-w
    issue: "#4916"

    Phase 4 closing audit of design #4912 (issue #4916, PR #8224) — origin summary for this phase:

    Phase 1 (this issue, #4757) — landed and closed. poll.py's session list is read by fetch_sessions() with escalating limits (1000 → 10000 → 100000); the first read below its limit is the whole list by construction, and all reads at their limit fail closed (None) instead of undercounting the cap or reporting a bound session gone. The old truncating-at-50 GET /api/session read is gone.

    Phase 4's inventory (README, "The Session Contract (#4912)") dispositions this call compliant with contract rule 1 (judge a session by its own record). This issue stays closed; no acceptance item was found unmet.

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/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)meta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/highImportant and time-sensitivesource/design-architectFiled by the repo design architect jobsource/queue-workerFiled or worked by the queue/worker pilottask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

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.