fix(sight): persist idle streams and tool results#1394
Conversation
Drain idle in-flight streamed calls so interrupted conversations remain visible as pending evidence. Preserve Anthropic tool_result blocks as structured input messages and add coverage for oversized request-body eviction. Assisted-by: Codex Signed-off-by: wanghao <1562495626@qq.com>
|
Re-checked this one closely since it's timing-bounded — it holds, with a scoping note. New in this PR: Consequence: Attribution, to be fair: the exit-without-exit-code gate and "pending row at clean exit → agent_crash" behavior already exist on |
Idle SSE persistence now writes source metadata and a deterministic pending match key so timeout snapshots stay distinguishable from crash drains. The aggregator snapshots idle connections without removing in-memory stream state. Resumed streams can promote the stored pending row instead of losing the active SSE flow. The match key uses request metadata and body bytes. If the parser cannot reconstruct the same request shape, completion still falls back to the existing insert path. Assisted-by: Codex:GPT-5 Signed-off-by: wanghao <1562495626@qq.com>
|
The idle-drain fix closes the finding I raised — a clean process exit no longer sweeps idle-drained rows into a spurious Critical
Both halves of the original concern are addressed: the One thing blocking merge, though — CI is red on Commit Message Lint (not the tests; Both commits trip it — the bodies have lines of 146/359 chars ( |
749795a to
183a697
Compare
|
Additional note on the code changes made for the earlier #1394 review feedback. The review concern was that persisting idle streams could make an active stream The PR now addresses that by:
Validation was run on the Linux test host:
The latest force-push only wrapped commit message bodies for commitlint; it did |
jfeng18
left a comment
There was a problem hiding this comment.
Idle-drain finding closed and verified (build + 51 passed + mutation on the filter). CI now green after the commit-body rewrap; code is byte-identical to the version I verified. LGTM.
Description
Persist idle in-flight streamed calls so manually interrupted conversations remain visible as pending evidence instead of being silently dropped. This also preserves Anthropic
tool_resultblocks as structured input message parts so downstream scoring can distinguish actual tool failures from historical raw context.This PR also adds regression coverage for oversized request-body eviction and includes the current-toolchain mechanical AgentSight clippy fixes required for this split PR to pass
-D warningsindependently.Related Issue
Refs #1304
Type of Change
Scope
cosh(copilot-shell)cosh-ng(cosh-ng)sec-core(agent-sec-core)skill(os-skills)sight(agentsight)tokenless(tokenless)ckpt(ws-ckpt)memory(agent-memory)anolisa(anolisa-cli)skillfs(SkillFS)Checklist
cosh: Lint passes, type check passes, and tests passcosh-ng:cargo clippy --all-targets -- -D warningsandcargo fmt --checkpasssec-core(Rust):cargo clippy -- -D warningsandcargo fmt --checkpasssec-core(Python): Ruff format and pytest passskill: Skill directory structure is valid and shell scripts pass syntax checksight:cargo clippy -- -D warningsandcargo fmt --checkpasstokenless:cargo clippy -- -D warningsandcargo fmt --checkpassmemory(Linux only):cargo clippy --all-targets -- -D warnings,cargo fmt --check, andcargo testpassanolisa:cargo clippy --all-targets --locked -- -D warnings,cargo fmt --all --check, andcargo test --lockedpassskillfs:cargo fmt --all --check,cargo clippy --workspace --all-targets -- -D warnings, andcargo test --workspacepasspackage-lock.json/Cargo.lock)Testing
Ran on the Linux AgentSight test host from an archive of this split branch:
cargo fmt --all -- --checkcargo test -p agentsight aggregator --locked --quietcargo test -p agentsight genai::call_builder --locked --quietcargo clippy -q -p agentsight --all-targets --locked -- -D warningsAdditional Notes
Split from #1349 following review feedback to keep capture fixes separate from the grader API and dashboard work.