Repository navigation
feat(session): support kiro-cli v3 engine and Kiro workflows over ACP - #1609
Conversation
…subprocess tests to ignored Review fixes for #1609 (Refs #1607). - Workflow tail: starts draining right after the prompt response and posts only once the original reply is delivered (oneshot gate); hard cap is measured from the prompt response; buffer capped at 256 KiB with a truncation note; each post bounded to 30 s so a stalled platform call cannot hold the task. - Strict default_config_options no longer uses the slash-command fallback (set_config_option_reported), so a locally synthesized value cannot confirm an option; warn when the agent does not report the option. - Subprocess/filesystem tests are now #[ignore]d integration tests; new tests for buffer cap, gate, cap-from-response, stalled delivery, fallback-masking, and the subscriber swap through AcpConnection::session_prompt. - Docs: wording fixes, per-turn workflow tracking limit. Verified on macOS (macmini): - cargo clippy --workspace [--features unified] -- -D warnings: clean - cargo test --workspace --no-fail-fast: all pass except the pre-existing secrets::tests::resolve_exec_nonzero_exit (/bin/false path on macOS) - cargo test -p openab-core --lib -- --ignored config_option_tests workflow_meta_tests: 11 passed
…subprocess tests to ignored Review fixes for #1609 (Refs #1607). - Workflow tail: starts draining right after the prompt response and posts only once the original reply is delivered (oneshot gate); hard cap is measured from the prompt response; buffer capped at 256 KiB with a truncation note; each post bounded to 30 s so a stalled platform call cannot hold the task. - Strict default_config_options no longer uses the slash-command fallback (set_config_option_reported), so a locally synthesized value cannot confirm an option; warn when the agent does not report the option. - Subprocess/filesystem tests are now #[ignore]d integration tests; new tests for buffer cap, gate, cap-from-response, stalled delivery, fallback-masking, and the subscriber swap through AcpConnection::session_prompt. - Docs: wording fixes, per-turn workflow tracking limit. Verified on macOS (macOS (aarch64) builder): - cargo clippy --workspace [--features unified] -- -D warnings: clean - cargo test --workspace --no-fail-fast: all pass except the pre-existing secrets::tests::resolve_exec_nonzero_exit (/bin/false path on macOS) - cargo test -p openab-core --lib -- --ignored config_option_tests workflow_meta_tests: 11 passed
6029c59 to
478e814
Compare
All changes are opt-in; with the new keys unset behaviour is unchanged. - [agent] session_new_meta: table sent verbatim as `_meta` in session/new (e.g. kiro.settings.workflows.enabled = true). - [pool] strict_default_config_options (default false): after each session/set_config_option compare the returned currentValue with the requested value and fail session creation on a mismatch or error. Responses without that option and name aliases are accepted. - With workflows enabled, drop session/update frames whose params.sessionId differs from the served session (workflow step sessions). - With workflows enabled, keep reading after the prompt response and post late workflow output as a follow-up message in the thread ([pool] workflow_tail_quiet_secs=20, workflow_tail_max_secs=900, 0 = off). - docs/kiro-v3.md, config reference and config.toml.example. Refs #1607 Verified on macOS (cargo, workspace): - cargo clippy --workspace -- -D warnings: clean - cargo clippy --workspace --features unified -- -D warnings: clean - cargo test --workspace --no-fail-fast: all pass, including the new tests, except secrets::tests::resolve_exec_nonzero_exit, which fails on macOS without these changes too (it execs /bin/false, which is /usr/bin/false there). - Touched hunks are rustfmt-clean; the repo is not fmt-clean on main, so unrelated files were not reformatted.
…subprocess tests to ignored Review fixes for #1609 (Refs #1607). - Workflow tail: starts draining right after the prompt response and posts only once the original reply is delivered (oneshot gate); hard cap is measured from the prompt response; buffer capped at 256 KiB with a truncation note; each post bounded to 30 s so a stalled platform call cannot hold the task. - Strict default_config_options no longer uses the slash-command fallback (set_config_option_reported), so a locally synthesized value cannot confirm an option; warn when the agent does not report the option. - Subprocess/filesystem tests are now #[ignore]d integration tests; new tests for buffer cap, gate, cap-from-response, stalled delivery, fallback-masking, and the subscriber swap through AcpConnection::session_prompt. - Docs: wording fixes, per-turn workflow tracking limit. Verified on macOS (macOS (aarch64) builder): - cargo clippy --workspace [--features unified] -- -D warnings: clean - cargo test --workspace --no-fail-fast: all pass except the pre-existing secrets::tests::resolve_exec_nonzero_exit (/bin/false path on macOS) - cargo test -p openab-core --lib -- --ignored config_option_tests workflow_meta_tests: 11 passed
…is pending Review finding: the notify channel was unbounded and run_tail stopped receiving while awaiting a platform delivery (up to 30s), so late frames piled up outside the 256 KiB text cap. send() now selects over the delivery future and rx, ingesting frames into the capped buffer; text collected during a delivery is flushed afterwards. Added a flood test. Validation (macOS (aarch64) builder): clippy --workspace and --features unified -D warnings clean; cargo test --workspace --no-fail-fast all pass except the pre-existing macOS secrets::resolve_exec_nonzero_exit (/bin/false); --ignored config_option_tests workflow_meta_tests: 11 passed.
…the hard cap - run_tail: after the delivery that crosses the hard cap, do one bounded final flush of frames drained during it before the "still running" note (review: output lost at the cap boundary). Frames arriving during that final flush are dropped. - strict mode: a set_config_option reply without a result no longer falls back to the cached pre-switch options. - test: text_buffered_while_a_delivery_crosses_the_hard_cap_is_flushed (paused time). Validation (Linux x86_64 builder; the macOS builder was unreachable): - cargo clippy --workspace -- -D warnings: clean - cargo clippy --workspace --features unified -- -D warnings: clean - cargo test --workspace --no-fail-fast: all pass (openab-core 775 passed, 11 ignored) - cargo test -p openab-core --lib -- --ignored config_option_tests workflow_meta_tests: 11 passed - cargo fmt --check: only my touched file is clean; other files differ on that toolchain's rustfmt version (pre-existing, untouched).
The tail ended at its first quiet flush when no run was open, so a summary that arrived after more than workflow_tail_quiet_secs was dropped. Thinking and tool frames also did not restart the quiet timer, so a pause inside a summary split it into two messages. - The tail now ends on channel close, at the hard cap, or when the next prompt replaces its subscriber. Quiet time only decides when text is posted. - Any parent-session session/update restarts the quiet timer. Those frames are not posted. - The 256 KiB buffer cap and the 30 s delivery timeout are unchanged. - Tests: a summary after a 25 s gap is delivered; thought and tool frames keep a summary in one message; an idle tail ends at the cap with nothing posted; a stalled delivery no longer stops later output. - docs/kiro-v3.md describes the behaviour as implemented. Refs #1607 Checks run on the remote macOS build host, from an rsync of this worktree (target and .git excluded): - rustfmt --check --edition 2021 crates/openab-core/src/workflow_tail.rs: pass - cargo fmt --check (workspace): fails on 666 files this change does not touch; root CI runs no workspace fmt, so this is pre-existing - cargo clippy --workspace -- -D warnings: pass - cargo clippy --workspace --features unified -- -D warnings: pass - cargo test --workspace: 776 passed, 1 failed, 11 ignored. The failure is secrets::tests::resolve_exec_nonzero_exit, which also fails on the committed base on the same host. - Negative check (scratch copy): with the quiet-timer refresh removed, thought_and_tool_frames_keep_a_summary_in_one_message fails.
Gate F1: the relay queue between the connection reader and the tail was an unbounded channel, and the cap epilogue stopped reading it. The relay queue is now a bounded channel of 1024 frames. A full queue drops the newest frame, and the next flush is marked "output truncated". Foreground prompts keep the unbounded queue. Frames still queued for the foreground receiver move to the relay queue under the subscriber lock, so their order is kept. The cap epilogue now reads queued frames and discards them, so the queue keeps draining until the tail returns. Gate F2 and R3/P2: quiet-gap splitting applies whether or not a run is open. Once text is cut at 256 KiB, later text is dropped too, so the posted text is a contiguous prefix before the truncation note. docs/kiro-v3.md now describes this, the queue limit, and the parent-session traffic note (R6/N2). Regression tests: - queue_overflow_while_delivery_is_stalled_is_bounded_and_marked - text_after_a_cut_is_not_appended_out_of_order - summary_after_a_quiet_gap_is_delivered (R1, already present, unchanged) Validation on remote macOS build host (aarch64, rust stable): - rustfmt --check on workflow_tail.rs, acp/connection.rs, adapter.rs: pass (repo CI has no fmt step; 666 untouched files differ under cargo fmt) - cargo clippy --workspace -- -D warnings: pass - cargo clippy --workspace --features unified -- -D warnings: pass - cargo test --workspace --no-fail-fast: 778 passed, 1 failed, 11 ignored. The failure is secrets::tests::resolve_exec_nonzero_exit, which the recorded results of earlier commits also show failing on the base. - cargo test -p openab-core --lib -- --ignored: 11 passed, 0 failed. Refs #1607
Gate R2/P1, decided by council (option b): a 256 KiB late flush split to the platform limit becomes about 130 messages, and the 30 s deliver timeout could cut it off before the truncation note. A flush now posts at most 16 platform messages. When the text needs more, the first 15 are posted and the 16th is a truncation note, so dropped output is always announced. The split still uses each platform's message_limit. The queue bound (1024 frames) and the 256 KiB buffer cap are unchanged. Limits that remain: one flush has a 30 s budget in total. A slow platform can stop it before the note is posted. Messages are sent one at a time, and rate limiting is left to the platform client. Neither was tested against a live platform. Tests: flush_messages_are_capped_with_a_note_in_the_last_slot and full_buffer_splits_into_at_most_the_cap_on_a_discord_sized_limit. Validation on remote macOS build host: - rustfmt --check on workflow_tail.rs, acp/connection.rs, adapter.rs: pass - cargo clippy --workspace -- -D warnings: pass - cargo clippy --workspace --features unified -- -D warnings: pass - cargo test --workspace --no-fail-fast: 780 passed, 1 failed, 11 ignored. The failure is secrets::tests::resolve_exec_nonzero_exit, which also fails on the base. - cargo test -p openab-core --lib -- --ignored: 11 passed, 0 failed. Refs #1607
c275d4d to
615a3f9
Compare
Gate F1 (Sol, blocking; Opus F1 non-blocking): TRUNCATED_NOTE said further workflow output is not relayed, but a flush is capped at 16 messages and later flushes are still relayed. The note now says this update stopped at 16 messages, the rest was not posted, and later output is still relayed. docs/kiro-v3.md is updated to match. Gate F2 (Opus, low, one line): when the channel closed while the original reply's gate was still closed at the hard cap, run_tail flushed buffered text before the reply. It now returns without posting, like the cap branch does. Unit test: flush_messages_are_capped_with_a_note_in_the_last_slot asserts the exact note text. Validation on macmini (~/scratch/openab-kiro-v3, rsynced from this worktree): - cargo clippy --workspace -- -D warnings: exit 0 - cargo clippy --workspace --features unified -- -D warnings: exit 0 (manifest lint warnings only: unused clap, tracing-subscriber, and rmcp under unified; pre-existing, not touched) - cargo test -p openab-core workflow_tail: 21 passed, 0 failed Not run: cargo fmt (per task). Known pre-existing failures not touched: fmt diff on main, secrets::tests::resolve_exec_nonzero_exit on macOS.
Gate F1 (Sol, blocking): the cap note must be flush-scoped. The note now reads "this flush was cut at 16 platform messages and the rest of this flush was not sent; later output is still relayed". docs/kiro-v3.md and the unit test flush_messages_are_capped_with_a_note_in_the_last_slot assert the same text. The PR body is updated to match. Validation on macmini (~/scratch/openab-kiro-v3, rsynced from this worktree): - cargo clippy --workspace -- -D warnings: exit 0 - cargo clippy --workspace --features unified -- -D warnings: exit 0 (manifest lint warnings only, pre-existing) - cargo test -p openab-core workflow_tail: 21 passed, 0 failed Not run: cargo fmt. Known pre-existing failures not touched: fmt diff on main, secrets::tests::resolve_exec_nonzero_exit on macOS.
This comment has been minimized.
This comment has been minimized.
F1 strict_default_config_options: a set_config_option response that does not list the requested option id now fails session creation (it used to pass). verify_config_option_applied returns an error with "the agent did not report the `<id>` option"; the non-strict path is unchanged. Files: acp/connection.rs, acp/pool.rs. F2 session/update filter: while workflows are enabled, a session/update is kept only when params.sessionId is the served session's string id. Missing, null and non-string ids are dropped. Responses and other methods are untouched. No kiro-cli fixture omits sessionId; the repo's ACP schema requires it on SessionNotification, so this is a code change, not a documented exception. Files: acp/protocol.rs (is_foreign_session_update, test), adapter.rs call site unchanged in behaviour. F3 tail ordering: spawn_tail returns a completion receiver stored on the connection (conn.tail_done). The next turn waits for it right after session_prompt, bounded by DELIVER_TIMEOUT (30 s), before posting. New test next_reply_waits_for_the_previous_tail_final_flush. Files: workflow_tail.rs, adapter.rs, acp/connection.rs, docs/kiro-v3.md. F4 formatting churn: reverted rustfmt-only hunks in warn_force_evicting_hung, with_connection, set_config_option, get_usage, cancel, reset_session, the facade-token tests and the redaction test. git diff origin/main -- pool.rs now contains only PR hunks. Docs (docs/kiro-v3.md): strict-mode failure rule, sessionId rule, and the tail-ordering rule with its 30 s bound. Validation (macmini, worktree synced to ~/oab-verify-kiro-v3-fix2, DEVELOPER_DIR=/Library/Developer/CommandLineTools because the Xcode license is not accepted on macmini): - cargo clippy --workspace -- -D warnings: pass - cargo clippy --workspace --features unified -- -D warnings: pass - cargo test -p openab-core --no-fail-fast: 743 passed, 1 failed (known: secrets::tests::resolve_exec_nonzero_exit on macOS), 13 ignored - cargo test -p openab-core --lib config_option_tests -- --ignored: 10 passed (includes strict_response_without_options_fails_session_creation and strict_response_lacking_the_requested_option_fails_session_creation) - named: acp::protocol::tests::foreign_session_update_detection, acp::connection::workflow_meta_tests::verify_rejects_missing_option_or_empty_list, acp::connection::workflow_meta_tests::verify_rejects_kiro_v2_agent_option_for_mode_key, workflow_tail::tests::next_reply_waits_for_the_previous_tail_final_flush: all pass Known pre-existing, not changed: cargo fmt --check drift on main; the rustfmt drift in untouched lines of the changed files.
This comment has been minimized.
This comment has been minimized.
…ests in CI
F1: the next reply no longer gives up on the previous workflow tail after
DELIVER_TIMEOUT. wait_for_previous_tail (workflow_tail.rs) waits with no timeout.
The connection cancels a tail before the next prompt replaces its subscriber
(AcpConnection::session_prompt drops tail_cancel), and on teardown (dropping
the connection drops tail_cancel). A cancelled tail discards buffered text,
drops an in-flight deliver, and signals completion, so nothing posts after the
cancel and the wait cannot hang. TailControl {gate, cancel} replaces the bare
gate in run_tail and spawn_tail; adapter.rs creates the cancel channel.
docs/kiro-v3.md documents the cancel path.
Tests (workflow_tail.rs): next reply waits for a slow previous flush and is not
interleaved; teardown cancels an in-progress tail and nothing posts after the
next reply starts; a cancelled tail does not post buffered text. The connection
test next_prompt_replaces_subscriber_and_ends_the_tail now expects buffered text
to be discarded on the next prompt.
F2: removed #[ignore] from the 13 lifecycle tests (connection.rs
workflow_meta_tests, pool.rs config_option_tests). They run in the required
CI check job, in the cargo test --workspace step. They use a local sh mock agent
and tempdirs, need no network, and passed on three repeats.
Validation (macmini, rsync of this worktree):
- cargo clippy --workspace -- -D warnings: pass
- cargo clippy --workspace --features unified -- -D warnings: pass
- cargo test -p openab-core: 758 passed, 1 failed (secrets::tests::resolve_exec_nonzero_exit, pre-existing on macOS)
- cargo test -p openab-core -- --include-ignored (900 s bound): 758 passed, 1 failed (same pre-existing test)
- lifecycle and workflow_tail tests, 3 repeats: 44 passed each run
This comment has been minimized.
This comment has been minimized.
|
Note LGTM ✅ - Round 3 F1 is resolved: the PR description now matches the cancel design, lists the discarded-buffer trade-off as an accepted residual risk, and records validation for the current head. Code is unchanged from round 3, round 2 findings stay fixed, and CI is green. What This PR Doeskiro-cli 3.x has a v3 engine that selects agents as ACP modes and runs Kiro workflows. Today openab silently stays in the default How It Works
Findings
Finding Details🟢 F1: PR description matches the codeRound 3 asked for three description changes with no code change. All three are in place on the unchanged head
🟢 F2: Ordering against the next reply is guaranteed
🟢 F3: Untimed wait cannot hang
🟢 F4: Lifecycle tests are part of the required gateWith 🟢 F5: Docs and surface
Baseline Check
CIAll required checks pass on Reviewer Verdicts
What's Good (🟢)
5. Three Reasons We Might Not Need This PR
|
chaodu-agent
left a comment
There was a problem hiding this comment.
Note
LGTM ✅ - Round 3 F1 is resolved, round 2 findings stay fixed, and CI is green on 5011eabb.
Consolidated review: #1609 (comment)
GitHub event: COMMENT - self-review delivery only; this is not an approval.
What problem does this solve?
kiro-cli 3.x has a second engine (
--agent-engine=v3) that selects agents as ACP modes and adds Kiro workflows. Today openab cannot use either safely: an unknown mode silently leaves the session in the defaultvibemode, workflows cannot be enabled, workflow step sessions leak text into the parent's reply, and the workflow summary that arrives aftersession/promptreturns ends up in the next reply.Refs #1607
Review Contract
Goal
Let an operator run kiro-cli v3 and Kiro workflows through openab by configuration only, with all four changes from #1607 opt-in so existing v2 bots behave identically by default.
Non-goals
~/.kiro/agents/*.md.docs/kiro-v3.md.session_new_metaordefault_config_optionsonsession/loadresume.acpgateway platform.Accepted Residual Risks
session/load) are not re-sent_metaordefault_config_options. Unconfirmed whether kiro-cli v3 restores workflows and the mode itself. Recovery: end the thread so a fresh session is created.workflow_tail_quiet_secscan split one summary into two messages.workflow_tail_max_secs, then a warning message is posted.strict_default_config_options = true.Acceptance Criteria
session/newparams,set_config_optionhandling, reply streaming andprompt_doneare unchanged, and the existing tests pass unmodified.[agent] session_new_metais sent as_metainsession/newand rejected at parse time when it is not a table.strict_default_config_options = true, acurrentValuethat differs from the request (and is not a name alias), a response that does not report the option, or an error fromset_config_option, fails session creation with an error naming the option, the requested and the reported value.session/updateframes with a foreignparams.sessionIdare dropped from the reply, and permission requests from any session are still auto-answered._Workflow update:_, quiet time only decides when buffered text is posted. The tail does not end on quiet. It ends on connection close, the next prompt, orworkflow_tail_max_secs.cargo clippy --workspace -- -D warnings(also with--features unified) andcargo test --workspacepass.Follow-ups
_metaanddefault_config_optionsonsession/load.~/.kiro/agents/<name>.mdfile.At a Glance
Prior Art & Industry Research
Not researched against OpenClaw or Hermes Agent for this PR. The behaviour is derived from a protocol probe of kiro-cli 3.3.0 documented in #1607 (frame order,
_metaplacement, silent mode fallback, late unsolicited chunks). The design choices below follow from that evidence.Proposed Solution
All four changes are opt-in.
[agent] session_new_meta(table, default none). Sent verbatim as_metainsession/new, for example{ kiro = { settings = { workflows = { enabled = true } } } }. kiro-cli 3.3.0 only honours it insession/new, not ininitialize. Not sent onsession/load.[pool] strict_default_config_options(defaultfalse). After eachsession/set_config_optionthe returnedcurrentValueis compared with the requested value. Rules when enabled: a response with no option of that id fails session creation, because nothing confirms the value, a value that matches by option display name is accepted (alias), anything else fails session creation and kills the agent process, and an error from the call fails too. In strict mode the legacy slash-command fallback is not used, so only a value the agent reports counts. See "Why this approach".session/updateframe is kept only whenparams.sessionIdis the served session's string id. A frame whosesessionIdis missing, null, non-string or a different string is dropped. Other methods and responses are never dropped. Permission requests are answered by request id before any filtering, so step sessions still get their auto-approval.session/promptreturns before the workflow ends, and the final text arrives later as unsolicitedagent_message_chunkframes of the parent session. If a_kiro/workflow/run_startfor this session was seen during the turn, the turn keeps the notify receiver and hands it to a detached tail task right after the prompt response. The tail drains frames at once but posts nothing until the original reply is delivered._Workflow update:_and split to the platform message limit. One flush posts at most 16 platform messages. When the text needs more, the first 15 are posted and the 16th says this flush was cut at 16 platform messages and the rest of this flush was not sent; later output is still relayed. The earlier reply is not edited, and reactions are not touched. Not used on platformacp.workflow_tail_quiet_secs(default 20) flushes buffered text after that long without output and posts text after a pause whether or not a run is open. Quiet time does not end the tail.workflow_tail_max_secs(default 900,0disables the relay) is a hard cap measured from the prompt response (not from reply delivery). Buffered text is capped at 256 KiB (later text is dropped and the post ends with a truncation note, so the text stays a contiguous prefix). The relay queue holds at most 1024 frames; overflow drops the newest frame and marks the next post truncated. One flush has a 30 s budget in total, so a stalled platform call cannot hold the task. If the platform is slower than that, the flush stops and the truncation note may not be posted. At the cap any buffered text is flushed and, if a run is still open, a warning says further output is not relayed.session_promptreplaces the subscriber, which cancels the tail. A cancelled tail discards its buffered, unposted text and posts nothing more. The next turn's reply waits for the cancelled tail to finish, with no timeout. Connection teardown (reset, idle cleanup, eviction, shutdown) cancels the tail the same way. A tail is armed only after a turn without error in which a workflow started for this session.session_new_metaenableskiro.settings.workflows.enabled. A normal turn takes the unchangedprompt_done()path.Docs: new
docs/kiro-v3.md(args["acp","--agent-engine=v3"],default_config_options = { mode = "<agent>" },~/.kiro/agents/<name>.md, emptymcp.json, about 0.5 GB per kiro-cli process, security notes), plusdocs/kiro.md,docs/config-reference.mdandconfig.toml.example.Why this approach?
Item 2 is opt-in, not strict by default, because a strict default would break working configs.
agy-acpanswers success with a differentcurrentValuewhen it normalizes a requested model name, and its own test asserts that. The repo shows noset_config_optionbehaviour for the other backends, so alias normalization there cannot be ruled out. kiro v2 reports modes under the option idagent, so amodekey finds no option: non-strict mode ignores it and strict mode fails on it. The v3 docs tell operators to turn it on.The tail is a detached task that owns the receiver instead of a change to the reader loop or the connection mutex. That leaves the notify channel type, the lock order and every existing path as they are, and a hung workflow cannot block the next user message.
Alternatives Considered
Validation
Run on macOS (aarch64) with cargo, on the remote macOS build host, against 5011eab (the current head). Results as recorded in the commit message of 5011eab:
cargo clippy --workspace -- -D warningscleancargo clippy --workspace --features unified -- -D warningscleancargo test -p openab-core: 758 passed, 1 failed (secrets::tests::resolve_exec_nonzero_exit, which fails on macOS without these changes because it runs/bin/false, which only exists at/usr/bin/falsethere). CI on Linux runs it.cargo test -p openab-core -- --include-ignored: same result.workflow_tailtests, 3 repeats: 44 passed each run.CI / check, which now runs the 13 lifecycle tests.mainis not fullycargo fmtclean, so unrelated files were not reformatted.New tests:
meta_enables_workflows(string"true"is false), pool defaults and explicit values, validation of quiet = 0.queue_overflow_while_delivery_is_stalled_is_bounded_and_marked), no out-of-order text after a cut (text_after_a_cut_is_not_appended_out_of_order), late summary after a quiet gap (summary_after_a_quiet_gap_is_delivered), thought and tool frames keep one message (thought_and_tool_frames_keep_a_summary_in_one_message).session/newparams: legacy shape has no_meta; with meta it carries the workflows switch; anshmock agent acceptssession/newonly when_metais present.agentoption; pool with theshmock agent: mismatch ignored by default, strict mismatch fails, strict match passes, nocurrentValuekeeps legacy behaviour, strict error response fails, non-strict error only warns.is_foreign_session_updatefor same, different, missing and non-string ids, other methods and responses; a duplex reader-loop test shows a permission request from another session is still answered.run_tailwith paused time: delivery after run complete and quiet, step-session text dropped, replaced subscriber cancels the tail without posting its buffer, and teardown cancels it too, run that never completes warns at the cap, text during an open run flushes and the tail continues, idle tail ends with no output, closed channel ends;TurnWorkflowStatearms only for its own session.End-to-end against kiro-cli 3.3.0 through the Rust code: not run for this PR. The protocol facts the code relies on (
_metainsession/new, silentvibefallback, frame order, late unsolicited chunks, per-session permission requests) come from the earlier probe recorded in #1607, not from a new run of this branch.Testing (updated)
Pure logic stays inline (config parsing,
_metaparams, option comparison, frame classification, tail state machine with paused time, including buffer cap, gate, cap from prompt response and stalled delivery). Scenarios that spawn a mock agent subprocess or use the filesystem run in the default test job (13 tests, see below), including strict-mode failure despite a successful slash fallback and the subscriber swap throughAcpConnection::session_prompt. clippy (also--features unified) is clean; the full workspace test run passes exceptsecrets::tests::resolve_exec_nonzero_exit, which also fails on macOS without this change.Lifecycle tests in CI (review F2)
The 13 lifecycle tests (
workflow_meta_testsinacp/connection.rs,config_option_testsinacp/pool.rs) no longer carry#[ignore], so they run in the requiredCI / checkjob inside the existingcargo test --workspacestep. The alternative was a separate--include-ignoredjob. Removing the attribute was chosen because the tests are unix-only, use a localshmock agent and tempdirs, need no network, and passed three repeats. A failing lifecycle test fails that step and so the check job.Late workflow tail cancel (review F1)
The next prompt on a session cancels the previous workflow tail, and so does connection teardown (reset, idle cleanup, eviction, shutdown). A cancelled tail discards buffered, unposted text and posts nothing afterwards. Before this change, that buffered text was flushed when the next prompt arrived. The next reply now waits for the cancelled tail with no timeout. The cancel path is documented in
docs/kiro-v3.md.