Repository navigation
integration/0.5.49 (T705): T699, T700 - #377
Merged
Merged
Conversation
`agentmbx agents` read the session binding (liveAgents) while `mbx_agents` and the send receipt read the identity lease. When OpenCode evicted an idle MCP, the lease was released while the serve kept the session row alive, so the CLI showed "live" and the receipt showed "offline (released)" for hours. Liveness is now one answer (src/liveness.ts) composed from the lease, the live session row and the serve kind: - a released or expired lease whose session still runs is `idle` with its reason (claimable; wakeable when the T688 shared service or a registered T659 poller can start its next turn, which re-claims the mailbox); - the reason text uses only evidence every process can read, so all three surfaces agree; - `agentmbx agents` prints the shared state plus a trailing reason column and keeps shell senders visible as live; - mbx_agents/mbx_identity list follow through listIdentityStatus, and the receipt reports live-next-prompt/live-wake instead of offline; - the 30-minute lease idle TTL and the receipt's 3-minute heartbeat rule are unchanged. Adds test/liveness-agreement.test.ts covering held, released+service, released+standalone-poller, released+dead and unknown evidence. Checks: tsc --noEmit, npm run build (dist committed), identity-status, roster, opencode-poll-liveness, project-mailbox, liveness-activity, opencode-poller-wake, recipient-truth, agents-directory, chosen-identity, identity-cleanup, doctor-identities, delivery-guidance, cli-lease, mcp-leases, hooks, doctor-sessions, stranded, codex-activity, wake-dispatch, wake-contract, wake-project-mail, mcp-connection, mcp-lifecycle, cli-identity-handover.
… receipt OpenCode 2.x drives the plugin default `setup(ctx)` path and marks a turn at `session.execution.started` before the first tool. The busy-turn guard then treated every tool as mid-turn, so a revisit notice could only fall back; at the turn's end the plugin admitted it with `resume:false`, whose msg_ receipt can arrive without a session_message (T544), and discarded the pending copy. - Track tools-per-turn so the first tool of a turn places the note even when the v2 start event already marked the turn. - Drop a kept note only after it actually lands in a tool result. A stop no longer admits it through a receipt; `resume:true` is not used because starting a turn on an idle TUI is not the job of a resume note. - Keep a fresh conversation's start note on its existing queued admission, which the host materialises as the conversation begins. - Add v2 harness tests for both failures; update the two T187 hook tests that encoded the old receipt-retry contract. Checks: the two v2 tests fail on the pre-fix template and pass after it; opencode-resume, opencode-hooks, opencode-no-duplicate-loop, opencode-poller-wake, the full opencode-* suite, tsc --noEmit, npm run build.
sessionRowLive reads the real process table, so the fixture's fabricated low pid could be alive (EPERM) on CI. An expired holder whose session row still names a live process is legitimately idle under T699, so the row kept its task and lane and the T497 assertion failed with "idle" instead of "offline". Point the session binding at a reaped pid so the fixture is offline on every host. Test-only; no product change. Checks: roster.test.ts (9/9 with liveness-agreement), identity-status, agents-directory, tsc --noEmit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The roster helper assigned 1000+ fabricated pids; on CI those can be live system processes (alive() counts EPERM), so an expired holder whose session row still named one read idle and the seen_here fixture leaked into the list. hold() now assigns an OS-reaped pid, making every persona fixture deterministic; the T497 fixture no longer needs its manual session-row update. The liveness agreement dead/unknown fixtures and the Grok dead-harness check use reaped pids too. Audited: identity-status (injected evidence, no session rows), agents-directory (real process.pid), project-membership (stale rows, no leases), opencode-poll-liveness (released lease only for poll activity). Test-only; no product change. Checks: roster, identity-status, agents-directory, liveness-agreement and liveness-activity (19 pass), tsc --noEmit.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Merges #375 (T699) and #376 (T700) with --no-ff; Unreleased entries normalized, released sections byte-identical. Local build/tsc were deferred by the machine budget, so CI (including check-dist) is the validation.
🤖 Generated with Claude Code