Repository navigation
agent: the restore window never waits on a session that will not restore; release binaries scanned for seams - #159
Closed
jaredLunde wants to merge 1 commit into
Closed
jaredLunde wants to merge 1 commit into
jaredLunde wants to merge 1 commit into
Conversation
…ore; release binaries scanned for seams Audit of #156: - A listed restoring session could hold the 503 window for its full 10 min if it failed to start, ended with an error, got no events hub (its MCP catalog now empty), or panicked on every start. `mcp_events::restored` is now called on each of those terminal paths: a failed boot pin (events session or runtime session), a session body that ends with an error, a session that starts with no hub, and every panic (a restart reserves its own tokens again). Tests: a listed session with no events hub, and one whose transcript no longer opens, each close the window, so a dead token is 410 within moments; both stay 503 without the fix. - No test seam ships, enforced on the artifact: `build (release)` now runs `mise check:release-seams`, which scans every release binary for the `BEYOND_AI_AGENT_TEST_` prefix and fails on any hit (a grep, seconds; no extra build). The source checker stays as the fast early warning. The scanner is pinned by a test: it fails on this crate's debug build (which carries the seams), on a `concat!`-assembled name, and passes a clean file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JimHGjsfk2Ktm5GxyZJKKk
Contributor
Author
|
Superseded by #161 (the release-binary seam scan, split out). The restore-window half is dropped: it covers a narrow MCP Events webhook edge case, and main's current behaviour (a retrying server may get 503 for up to 10 min after a restart) is acceptable. |
jaredLunde
added a commit
that referenced
this pull request
Oct 7, 2026
The authority on "no test seam ships" is now the artifact itself: CI's `build (release)` job runs `mise check:release-seams`, which greps every top-level release binary for the BEYOND_AI_AGENT_TEST_ prefix and fails on any hit. tests/release_seams.rs stays as the fast source-level warning and pins the scanner (it must fail on the debug build and on a concat!-built name). Split out of #159; its restore-window half is dropped. Claude-Session: https://claude.ai/code/session_01JimHGjsfk2Ktm5GxyZJKKk Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.
This PR fixes the two LOW audit findings on #156. Each fix has a test that fails without it.
1. The restore window never waits on a session that will not restore
Problem: a listed restoring session could hold the 503 window for its full 10 minutes in four cases:
serve_wsonly logged);Fix:
mcp_events::restored(session_id)(now public) is called on each terminal path:serve_session_bodyending with an error;serve_sessionstarting with no events hub;Tests (
mcp_events_receiver):a_restoring_session_with_no_events_hub_closes_the_restore_window: the session's server is no longer configured on restart.a_restoring_session_that_fails_to_start_closes_the_restore_window: its transcript no longer opens.Each asserts that a token nothing holds is
410within 10 s. With the terminal calls reverted, both stay503and fail.2. The release binary is the authority on "no test seam ships"
crates/agent/scripts/scan-release-seams.shgreps each given artifact forBEYOND_AI_AGENT_TEST_and fails on any hit, listing the names it found. It checks what the compiler kept, so source tricks don't matter: aconcat!-assembled name, a//inside a string literal, anything a text heuristic misreads.build (release)job now runsmise check:release-seamsright aftermise build:rs:release, over every top-level release binary. It reuses the job's own artifacts, so there is no extra build and it adds seconds. The agent test shards are untouched.tests/release_seams.rsstays as the fast early warning and now says the binary scan is the authority.release_seams::the_release_artifact_scan_fails_on_any_seam_name. The scanner must fail on this crate's debug build (which carries the seams by design), must fail on aconcat!-assembled name, and must pass a clean file.Verification
-D warnings, all targets),cargo fmtanddprint checkare clean.mcp_events_receiver,mcp_events_nested,mcp_events_lifecycle,mcp_events_durability,release_seams,serve_service_session_end,serve_session_lifecycle,serve_harness_deadlines.🤖 Generated with Claude Code
https://claude.ai/code/session_01JimHGjsfk2Ktm5GxyZJKKk