Skip to content

fix(acp): bound the tool-call liveness map and warn on kas vocabulary drift - #20260

Merged
bolichen97 merged 1 commit into
mainfrom
fix/liveness-bound-kas-drift-18627
Oct 14, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
fix/liveness-bound-kas-drift-18627

Conversation

@bolichen97

@bolichen97 bolichen97 commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: A turn's memory for in-flight tool calls stays bounded on every harness, and a kas session says at start when its kiro-cli is one the tool-name tables were never checked on.

Two bounds were taken out of #17280 to keep that PR to the kas tool-name fix. Without them:

  • InFlightToolTracker and the handle's _tool_output_seen set keep one row per tool call with no terminal result yet, for the whole turn. A backend that sends many distinct tool_call frames and never reports their results grows these rows for the turn, and each row keeps the backend's title, command, tool_name, mcp_server_name and raw toolCallId at full length.
  • On a kiro-cli release the KAS tool-name tables were not verified on, a kiro-cli-named deny may not reach a renamed KAS built-in. Only kirocrew doctor says so, and an operator who never runs it does not see it.

Why it matters

Memory per turn is bounded only by the transport frame cap today, on every harness. And an operator who relies on kiro-cli-spelled denies on the kas backend can be on an unverified release without ever being told.

Not a goal

What changed (motivation → approach → change)

Every row the liveness bookkeeping holds is bounded, and so is the number of rows, on both transports: the session handle's attribution map (acp/liveness.py for the state and tracker, acp/session_handle.py for the stale-clock reading) and the AcpClient's open-call set (InFlightIdSet). The shared key and count bound live in acp/_dispatch.py beside the provenance caches' bounds they are named from.

Part Bound
rows per turn MAX_ACTIVE_TOOL_CALLS (the provenance caches' count bound, 256); at the cap the oldest row goes, the call just dispatched is always kept, and every eviction is counted
title, tool_name, mcp_server_name cut to 512 characters at construction
command, and the git editor hint built from it cut to 4096 characters, keeping the first 3568 and the last 512 so a long command's > file redirect still reaches the stall hint
toolCallId kept as is up to 512 characters, else held as its sha256 digest, the same at dispatch, output and terminal; an id that itself spells the sha256: prefix is digested too, so no raw id can equal another call's key
_tool_output_seen keyed the same way; admits only a call the map still holds; pruned to in-flight calls at the cap

After an eviction the turn is treated as still having a tool in flight until its clear: an emptied map does not prove that nothing runs, so the stale clock does not cancel-probe a call whose row was evicted; the turn is judged as an opaque tool in flight and ends, if it wedges, by the tool-stall recovery after the full build-scale window (acp-client.md records this). The overflow is said once per turn: the next turn's reset warns with the bound and how many rows were dropped. The sub-agent's tracker keeps no bound (its runtime emits one call at a time).

The KAS harness (acp/harness/kas.py, in resolve_spawn) logs once per kiro-cli release when it spawns the relay and the pinned binary's --version is not among the releases the KAS tool-name tables were verified on. It is the same comparison and the same reading as the kirocrew doctor row (kas_vocabulary_drift in platform/tool_names.py; KAS reports no agentInfo.version on the wire); the doctor row (cli_doctor.py) and the fixture note name the spawn-time warning as the second reader of verified_kiro_cli_versions. The process keeps the one release it last warned for, so the warning repeats only when the release changes. It lives on the harness and nowhere shared, so the Kiro path gains no conditional. The version parser (mcp_hot_reload.py) bounds each component to nine digits for every caller, so a harness-written version can never reach int() past CPython's digit limit.

Backwards compatibility

Compatible: every bound is above what a real turn produces (a turn does not hold 256 unfinished calls; a release string is a dozen characters), so nothing that works today reads differently. The drift warning is one log line.

Removes nothing: the change adds bounds and a log line; no path, record, key or function goes away.

Tests

  • test_acp_liveness.py: the tracker evicts the oldest at max_calls and keeps the new call judged; a re-dispatch under a held id evicts nothing; evicted resets on clear; an unbounded tracker never evicts.
  • test_stale_watchdog_rearm.py: through the handle, the map holds MAX_ACTIVE_TOOL_CALLS rows and the call in flight; every retained field is bounded (title, command, names, key, and the editor hint retained beside the row); the output-seen set takes only a call the map holds; the cmdline match fragment never spans the retention cut; a long id is popped by its terminal under the same digest; the output-seen set is pruned at the cap; after an eviction an empty map does not arm the stale clock; a non-string result id does not crash the turn; a bounded command keeps the redirect extract_log_redirect_target reads.
  • test_tool_call_classification.py: the kas drift warning fires once per release, the warned release is one slot and a changed release warns again, the measured release and an unknown version stay silent, the KAS spawn hands the pinned binary's probe to the warning (and still resolves when the probe cannot answer), and by source the warning lives on the KAS harness with nothing of it on the shared runtime.
  • test_stale_watchdog_rearm.py (key): a raw id spelling another call's digest key gets its own row, so its terminal pops only itself; evictions are counted and said once at the turn reset; the AcpClient set is bounded under the same key and count, counts its evictions, and keeps the tool clock armed after one.
  • test_mcp_hot_reload.py: a major or minor past nine digits is no version, an over-long patch is dropped rather than raised, nine-digit components still parse.

Determinism proof for the 18 new/changed node ids: 20 runs at -n0, 10 runs at -n 4 --dist loadgroup --max-worker-restart=2 with test/test_tool_names.py and test/test_acp_runtime.py as co-tenants, and one shuffled-order run (seed 8465), all green.

Manual verification

N/A — unit coverage sufficient: both bounds and the warning are exercised through the handle and runtime code paths the tests drive; the only live-only piece, the --version probe, is the same reader kirocrew doctor already uses.

Related Issues

Closes #18627

Pattern harvest

Rule candidate: review-prompt
Pattern: a per-turn map keyed by a backend-authored id, holding backend-authored strings, with no count or width bound

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners October 14, 2026 10:41
@bolichen97
bolichen97 requested a review from mbriones98 October 14, 2026 10:41
@bolichen97
bolichen97 enabled auto-merge (squash) October 14, 2026 10:41
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 14, 2026
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision 97b1b1c9d9a77ea376c266730eaf040eef73d8f8 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Advisory — does not block merge.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 97b1b1c9d9a77ea376c266730eaf040eef73d8f8 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: PASS

One thing to confirm: after an eviction, a wedged turn waits out the full tool-stall window, never the faster stale probe. That cost is accepted in acp-client.md; it needs a human sign-off.

Not justified as shipped

  • Item 8 — rides along: "The version parser (mcp_hot_reload.py) bounds each component to nine digits for every caller." This is outside the Goal, which covers per-turn memory and the KAS drift warning. It does name a real harm: a harness-written agentInfo.version longer than CPython's digit limit makes int() raise.

What this change ships

Inventory (9 items) — 8 justified

Intent: keep per-turn tool-call memory bounded on every harness, and tell KAS operators when their kiro-cli release was never checked against the tool-name tables. FIX (Closes #18627).

  1. A turn holds at most 256 open tool calls on both transports; the oldest is dropped first — justified
  2. Retained title, command, tool-name and server-name strings are cut to fixed lengths, keeping the command's tail — justified
  3. A tool-call id over 512 characters, or one starting sha256:, is held as its digest — justified
  4. After an eviction, an empty map no longer arms the stale probe; the tool-stall clock stays armed instead — justified
  5. The next turn's reset logs one warning with the eviction count — justified
  6. The output-seen set only admits calls the map holds, and is pruned at the cap — justified
  7. A KAS spawn logs the vocabulary-drift warning once per kiro-cli release — justified
  8. Version components past nine digits no longer parse, for every caller — rides along: hardens an unrelated parser
  9. kirocrew doctor names the spawn-time warning — justified

[FIRST-PRINCIPLES-REVIEWED] 97b1b1c

Description read

[DESCRIPTION-READ] 779c99aa5aa83033a11bc00e15a6f1b9d068d363457501c2214b75ca3f00be65

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 97b1b1c9d9a77ea376c266730eaf040eef73d8f8 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Before merging, check that a turn which goes past 256 calls is meant to lose stale-probe detection for the rest of that turn and wait out the full tool-stall window.

[DESIGN-REVIEWED] 97b1b1c

Description read

[DESCRIPTION-READ] 0c477595dd412545e23e8688ba54a41a885a731eb22145db67eaed85ea5aaca8

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 97b1b1c9d9a77ea376c266730eaf040eef73d8f8 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 97b1b1c

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 97b1b1c9d9a77ea376c266730eaf040eef73d8f8: <one-sentence reason>

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 97b1b1c9d9a77ea376c266730eaf040eef73d8f8 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 97b1b1c

Verdict parsed from the review's SHA-scoped output markers for commit 97b1b1c9d9a77ea376c266730eaf040eef73d8f8.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 97b1b1c9d9a77ea376c266730eaf040eef73d8f8: <one-sentence reason>

@bolichen97
bolichen97 force-pushed the fix/liveness-bound-kas-drift-18627 branch from ad367a8 to 86b91ec Compare October 14, 2026 11:04
@bolichen97

Copy link
Copy Markdown
Contributor Author
  • Raw IDs collide with generated digest keys span=19934bb5ba3d

fixed in 86b91ec: _liveness_key digests every id that starts with the sha256: prefix as well, whatever its length, so every key carrying the prefix is a digest and two digests agree only when the ids do; a raw id spelling another call's digest key gets its own row.
test_a_raw_id_can_never_equal_another_calls_digest_key locks it: the spoofed id's terminal pops only itself and the long call stays tracked with the stale clock disarmed.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • Item 8: the 64-character version guard patched one caller span=bb41e3cfb03b

fixed in 86b91ec: _MAX_VERSION_TEXT_LEN and its check are gone; _VERSION_RE in mcp_hot_reload.py bounds each component to nine digits with an end lookahead, so no caller of parse_kiro_cli_version (runtime, providers/acp.py, kiro_cli.py, slack gateway) can hand int() a run past CPython's digit limit.
test_mcp_hot_reload.py pins a ten-digit major or minor as no version, an over-long patch as dropped, and nine-digit components as still parsing.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • Item 9: the 32-version cap and its overflow log span=59dc71b7c3c0

fixed in 86b91ec: the set, _KAS_DRIFT_WARNED_MAX, _KAS_DRIFT_WARNED_OVERFLOWED and the overflow branch are removed. The process keeps one slot, the parsed (major, minor, patch) it last warned for, so the warning is said once per release and again only when the release changes; the slot is bounded by its own shape and retains no harness string.
test_the_warned_release_is_one_slot_and_a_changed_release_warns_again pins it.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • Key the liveness-map skip on positive refusal evidence span=761622a46645

fixed in 86b91ec: the skip reads what _refuse_unretained_provenance reads, scope_overflowed(self._tool_call_cache_overflow, self._session_id) AND no identity row for the id. A missing row alone keeps the call tracked, so a path that emits a call without the row is never invisible to _no_tool_in_flight(). The overflow record is written only where the admission runs, so a harness handed none skips nothing (H13).
On the PASS punchline: every harness's wire parser writes the _tool_call_tool_name row through the shared admission for an id'd call, and with the conjunction the row's presence no longer decides tracking on its own. test_the_skip_needs_positive_refusal_evidence_not_a_missing_row pins the no-overflow case.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 14, 2026
@bolichen97
bolichen97 force-pushed the fix/liveness-bound-kas-drift-18627 branch from 86b91ec to 05f7b22 Compare October 14, 2026 11:46
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 14, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author
  • Count and report evicted tool-call attributions span=173c38d5d26d

fixed in 05f7b22: InFlightToolTracker keeps _evicted_count (the evicted flag reads it), clear() resets it, and the handle's turn reset says the total once (_report_evicted_attributions, run before the clear) while the first-eviction warning still names the bound; the stale-clock guard is unchanged. The AcpClient's open-call set counts and reports the same way.
test_evictions_are_counted_and_said_once_at_the_turn_reset pins the count, the one report and the silence of a turn that evicted nothing.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • The second tracker is still unbounded span=349229faa01b

fixed in 05f7b22: AcpClient._active_tool_calls is a _dispatch.InFlightIdSet, bounded under the same liveness_key and the same MAX_ACTIVE_TOOL_CALLS (both moved to _dispatch.py beside the provenance bounds they are named from, so one constant bounds the population on both transports); oldest evicted first, evictions counted and said once at the next turn's reset, and possibly_open keeps the tool clock armed and the stale clock disarmed after an eviction.
test_client_open_call_set_is_bounded_under_the_shared_key pins the key, the cap, the count, the report and the post-eviction clocks.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • One eviction turns off stall recovery for the rest of the turn span=65c0b8621238

fixed in 05f7b22: docs/system-specs/modules/acp-client.md (session-handle watchdog) records the bounds and states the cost: after an eviction the turn falls back to the prompt timeout for stall recovery (_TOOL_STALL_TIMEOUT on AcpClient), never a cancel-probe that could stop a live call, accepted because a turn cannot legitimately hold that many open calls. The behaviour itself is unchanged; the eviction count said at the turn reset names the fallback in its message.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • After one eviction the stale clock stays off until the turn clears

rebutted as a defect, recorded as a cost: this is the safe direction. The evicted call may still be running, and a cancel-probe on an emptied map would stop it as a wedge that did not exist; a turn that wedges past 256 open calls still ends at the resolved prompt timeout (and AcpClient's _TOOL_STALL_TIMEOUT). 05f7b22 records that fallback in acp-client.md and in the per-turn eviction report, so the cost is stated where an operator reads it.

@bolichen97
bolichen97 force-pushed the fix/liveness-bound-kas-drift-18627 branch from 05f7b22 to 4ecf2aa Compare October 14, 2026 12:13
@bolichen97

Copy link
Copy Markdown
Contributor Author
  • Refused results bypass the output-seen admission cap span=19934bb5ba3d

fixed in 4ecf2aa: a streamed output is retained in _tool_output_seen only when its key is in _active_tool_calls, so an evicted or unknown id never enters the sibling store and the set cannot outgrow the map's bound; the prune at the cap stays.
test_the_output_seen_set_takes_only_a_call_the_map_holds pins a never-dispatched id and an evicted id both staying out.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • KAS warning adds an adapter conditional to Kiro construction span=60eee5df9fed

fixed in 4ecf2aa: the comparison moved behind the harness seam. KasHarness.resolve_spawn (acp/harness/kas.py) probes the pinned binary off the loop and calls warn_kas_vocabulary_drift; acp/runtime.py is byte-identical to origin/main (no membership conditional, no version probe, no import of the comparison), so the Kiro construction path gains nothing (H13). KAS reports no agentInfo.version, so the handshake-preference branch went with it.
test_the_warning_lives_on_the_kas_harness_and_nowhere_shared pins both by source; test_the_kas_spawn_probes_the_pinned_binary_once_per_call drives the spawn.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • Item 6: test-only __eq__/__hash__ and the _liveness_key alias span=14e576cc01d4

fixed in 4ecf2aa: InFlightIdSet.__eq__, __hash__ = None and __bool__ are gone (it keeps add, discard, difference_update, clear, possibly_open, evicted_count, __iter__, __len__, __contains__); the _liveness_key alias in session_handle.py is gone and the three call sites use liveness_key from _dispatch. The four client asserts read set(client._active_tool_calls) == {...} and the tests import liveness_key from _dispatch.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • Falling back to the prompt timeout after an eviction is acceptable

rebutted as a defect, accepted as the recorded cost: a turn that overflows 256 open calls is not a shape a real turn has (the provenance caches refuse at the same count), and the alternative -- arming the stale clock on an emptied map -- would cancel-probe a call that may still be running. The turn still ends at the resolved prompt timeout; acp-client.md records the fallback and the eviction report at the next turn's reset names it.
Retrospective (round 2, every third round): no revert; the admission skip from round 0 was removed in 4ecf2aa as beyond the goal (the map's own cap and eviction bound it, and a refused call's denied-tool terminal pops it), InFlightIdSet and the spec paragraph were trimmed; the digest key, the shared command cut, the parser digit bound, the one-slot warned release and the counted eviction report are kept, the last because the repository's bound rule requires overflow to be counted and said.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • The post-eviction prompt-timeout fallback must hold for claude and BYO harnesses too

rebutted as a defect, accepted as the recorded cost on every harness: the bound, the eviction and the fallback are harness-neutral (the handle's map and the AcpClient's set take the same key and count whatever the host), and the condition -- 256 calls of one turn with no terminal result -- is not a shape any harness's real turn has. On every harness the alternative would arm the stale clock on an emptied map and cancel-probe a call that may still run; the turn still ends at the resolved prompt timeout (AcpClient: _TOOL_STALL_TIMEOUT). acp-client.md records the fallback for both transports.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • Past 256 open calls the turn gives up the stale probe and waits out the build-scale tool-stall window

rebutted as a defect, accepted as the recorded cost: the evicted call may still be running, and a stale probe on an emptied map would stop it as a wedge that did not exist; judging the turn as an opaque tool in flight gives it exactly the forbearance any opaque tool gets (tool_stall_suspect_secs under the hard cap) before the same non-lethal recovery. A real turn never holds 256 open calls (the provenance caches refuse at the same count), so only a runaway backend reaches the window, and acp-client.md and the per-turn eviction report both state the trade.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • Measure the cold-start cost of installed_kiro_cli_version() on a real KAS install

rebutted as a defect, measured: on a real install (kiro-cli 2.31.0, Linux) the first installed_kiro_cli_version() call costs 29 ms (one --version spawn, off the loop via asyncio.to_thread, under the 5 s _VERSION_PROBE_TIMEOUT_SECS leash) and every later call 0.16 ms (cached by binary path and mtime). The cost is paid once per binary per process, not per session start, and it is the same read kirocrew doctor already makes.

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Oct 14, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in docs/system-specs/modules/acp-client.md and src/kiro_crew/acp/client.py since this head went green (c92621a -> e4270cf); CI re-running.

@bolichen97
bolichen97 force-pushed the fix/liveness-bound-kas-drift-18627 branch from 72faeca to 5450fe8 Compare October 14, 2026 13:28
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: passed Eligible automated validation passed for the current revision labels Oct 14, 2026
@bolichen97
bolichen97 force-pushed the fix/liveness-bound-kas-drift-18627 branch from 5450fe8 to 436dad5 Compare October 14, 2026 13:41
@bolichen97

Copy link
Copy Markdown
Contributor Author
  • Item 4: the handle reported one overflow twice span=fa67342c870c

fixed in 436dad5: the first-eviction logger.warning in the dispatch branch is gone; the handle keeps one overflow warning per turn, the count at the next turn's reset (_report_evicted_attributions, which names the bound and how far past it the turn went), as AcpClient does. The repository's bound rule asks for the overflow to be counted and said once, which is the one that stays. acp-client.md, the PR body and test_the_liveness_map_is_count_bounded_and_keeps_the_call_in_flight read the single report.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • The --version probe in KAS resolve_spawn must stay within its bound on the first cold spawn

rebutted as a defect, measured: the probe runs under _VERSION_PROBE_TIMEOUT_SECS (5 s) off the loop and is cached by binary path and mtime, so it is paid once per binary per process; on a real install (kiro-cli 2.31.0, Linux) the cold call took 29 ms and the cached call 0.16 ms. A binary that wedges costs the first KAS spawn at most five seconds, after which the spawn proceeds with "unknown" and no warning.

@bolichen97

Copy link
Copy Markdown
Contributor Author

needs-a-decision, put to the maintainer who approves: the two items were dispatched as one PR by the maintainers' triage (one commit, Closes #18627), the issue itself names them as the two halves removed from one earlier change, and each is independently reviewable here (the bound touches liveness.py, _dispatch.py, session_handle.py, client.py; the warning touches harness/kas.py, cli_doctor.py, tool_names.py, mcp_hot_reload.py). The human approval that merges this PR is the acceptance of the bundling; if the approver prefers two PRs, say so here and the kas-warning half moves to its own branch before merge.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • The --version probe on the KAS spawn path stays cached and bounded

rebutted as a defect, measured: installed_kiro_cli_version runs --version under _VERSION_PROBE_TIMEOUT_SECS (5 s) off the loop (asyncio.to_thread) and caches by binary path and mtime, so the spawn pays it once per binary per process (29 ms cold, 0.16 ms cached on a real kiro-cli 2.31.0 install); a wedged binary costs the first KAS spawn at most five seconds, then the spawn proceeds with "unknown" and no warning.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention labels Oct 14, 2026
… drift

The in-flight tool tracker and the handle's output-seen set kept one row per
tool call with no terminal result for the whole turn, each row holding the
backend's title, command, tool and server names and raw toolCallId at full
length. The tracker takes a row cap (the provenance caches' count bound), the
state cuts its strings at construction keeping a long command's tail so the
stall hint still finds its redirect, an over-long id is held as its digest,
and the stale clock stays disarmed after an eviction so a live call is never
cancel-probed.

The kas backend logs once per kiro-cli release at session start when the
installed binary is not one the KAS tool-name tables were verified on, the
same comparison the doctor row makes.

Closes #18627
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in directories this PR touches (src/kiro_crew, docs/system-specs/modules; no same-file overlap) since this head went green (e4270cf -> c8755ca); CI re-running.

@bolichen97
bolichen97 force-pushed the fix/liveness-bound-kas-drift-18627 branch from 436dad5 to 97b1b1c Compare October 14, 2026 15:21
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: passed Eligible automated validation passed for the current revision labels Oct 14, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author
  • A turn past 256 open calls loses the stale probe for the rest of that turn and waits out the tool-stall window

rebutted as a defect, accepted as the recorded cost: the evicted call may still be running, so a stale probe on an emptied map would stop a live call as a wedge that did not exist; judging the turn as an opaque tool in flight gives it exactly the forbearance any opaque tool gets (tool_stall_suspect_secs under the hard cap) before the same non-lethal recovery. Only a runaway backend reaches the condition (the provenance caches refuse at the same count); acp-client.md and the per-turn eviction report state the trade.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • After an eviction a wedged turn waits out the full tool-stall window, never the faster stale probe; the cost needs a human sign-off

needs-a-decision, put to the approving maintainer: the trade is deliberate and recorded in acp-client.md (the safe direction, since the evicted call may still run and a stale probe would cancel it); the condition is a runaway backend holding 256 unfinished calls in one turn, and the fallback is the same bounded tool-stall recovery any opaque tool gets. The human approval that merges this PR is the sign-off; if the approver wants the stale probe kept after an eviction instead, say so here and the _no_tool_in_flight guard becomes a one-line change.

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Oct 14, 2026

@mbriones98 mbriones98 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checks green and PR Readiness passed at 97b1b1c; non-feature change.

@bolichen97
bolichen97 merged commit ec99d90 into main Oct 14, 2026
102 of 103 checks passed
@bolichen97
bolichen97 deleted the fix/liveness-bound-kas-drift-18627 branch October 14, 2026 16:47
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bound the tool-call liveness map and restore the kas drift warning (split from #17280)

2 participants