Repository navigation
0.4.0: supervision diagnostics (partial summaries, tool output window, fleet git, creation reuse) - #11
Merged
Conversation
…eation reuse - Activity: last observed events, partial summary with stream_error on a stream error (never cached), wider last-tool-call clip. - Run lists and supervise rows expose git (the agent's current pushed state). - cursor_read_run_events(tool_output_limit): head+tail clip, upstream omitted flags (verified live 2026-10-09), global tool-text cap with resumable cursor. - cursor_create_agent(on_conflict=reuse): recover the existing agent on 409. - Docs: README, AGENT_GUIDE migration 0.3 -> 0.4, API contract, verification. - 133 tests; version 0.4.0.
The cap only applied to the incremental read: cursor_read_run_events(tail=…, tool_output_limit=4000) could return about 1.6 M chars of tool text (audit of 7991f4e, 50 tool calls: 392 000 chars returned against a 256 000 cap). - tail_view() now trims the returned suffix from its oldest side until the rendered tool text fits TOOL_TEXT_TOTAL_MAX_CHARS, keeping the newest events and the last_event_id coherent; truncated is set when the window was trimmed. - The replay walk is unchanged: it always runs to its usual stop criterion, so tail still reaches the recent events. - Shared tool_text_cost() helper, used by both read paths. - Regression test on the audited scenario: 50 tool calls clipped at 4000 per field, production cap: 32 calls kept, 256 000 chars, newest kept, truncated true. 134 tests.
Owner
Author
|
P2 fixed in bdcc341 (
134 tests pass; ruff clean. CI re-running on the new HEAD. |
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.
Implements the four improvement tracks in
TODO.md, from a real supervision session (an autoqueue supervisor,*_job.pyscripts, eight runners). Each track is a server-side means; no agent-side convention is prescribed.A — Error diagnosis
activity.last_events: the last ~10 events observed during the read, produced by the walk the summary already pays for.errorevent now returns the partial summary withstream_error: trueandcomplete: false(the error event stays inlast_events), never cached — previously the call returnedactivity_error: UPSTREAMand no summary._simplify()during the walk.B — Tool outputs
cursor_read_run_events(tool_output_limit=…)(default 500, max 4000) on both modes.…[clipped]…marker, total within the limit; assistant/thinking text is unchanged.tool_args_omitted/tool_result_omittedreport a field Cursor itself omitted upstream. Verified live on 2026-10-09: an 8 MB terminal output producedtruncated: {result: true}withresultabsent (one-off paid run, 17.3 s, 7.62 cents, agent deleted); the captured payload is frozen in the regression test and indocs/api-contract.md.last_event_idstays on the last event actually returned, so a resume returns the following events.D — Fleet state
git(withscope=agent_current_state) added tocursor_list_runsitems andcursor_superviserows, no extra API calls.C — Creation recovery
cursor_create_agent(on_conflict="reuse"), with a caller-suppliedagent_id: on409 agent_id_conflict, the existing agent is returned withreused: trueand its observedlatest_run_id(run_id/run_statusabsent). No run is sent; the prompt is not applied. A failed re-read stays anAGENT_ID_CONFLICTerror saying the same call can be retried.Checks
uv run pytest: 133 passed (+8).uvx ruff@0.16.10 check src tests scripts: clean.scripts/wheel_smoke.pyOK.AGENT_GUIDE.mdmigration 0.3 → 0.4,docs/api-contract.md,docs/verification.md. Also included:AGENTS.md(repo guidance for future agent sessions) andTODO.md(the contract of record).__version__is bumped to 0.4.0; the release runs when av0.4.0tag is pushed.