Repository navigation
Conversation
|
Important Review skippedWe couldn't safely recover the incremental review. No full review was started, and the last reviewed checkpoint was preserved. Retry later, or explicitly request a full review by commenting You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to
|
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Docstring Coverage | Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 5 files. | Write docstrings for the functions missing them to satisfy the coverage threshold. |
✅ Passed checks (4 passed)
-
Check name Status Explanation Title check ✅ Passed The title clearly identifies the daemon change: releasing the shell-ready barrier through a relayed-shell probe. Description check ✅ Passed The description covers the problem, implementation, linked issue, testing, and checklist. The visual-proof section says media is unavailable in this environment, but the template asks for proof for be… Linked Issues check ✅ Passed Issue #25586requires prompt startup-command delivery when a relay replaces the shell while preserving the guard against non-shell processes. The reviewed implementation checks a relay child’s shell i…Out of Scope Changes check ✅ Passed The update changes relay-child error handling in src/shared/shell-process-readiness.tsand adds a focused regression test. Both changes support reliable relay readiness for issue#25586. No unrelate…
- Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
8af0600a-e2f2-4b8a-b3a2-74417d213454
📥 Commits
Reviewing files that changed from the base of the PR and between 5cf3585 and fe9d78e01118ea7a3fd03b83f15b32ee19faeb49.
📒 Files selected for processing (4)
src/main/daemon/repro-13767-shell-ready-marker-lost-to-exec.test.tssrc/main/shell-prompt-readiness-probe.test.tssrc/main/shell-prompt-readiness-probe.tssrc/shared/shell-process-readiness.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
…probe When a startup profile `exec`s into a terminal relay (kiro-cli-term, figterm-style shell integration), the foreground process is no longer the launched shell and the wrapper's orca-shell-ready marker never arrives — so SessionShellReadyBarrier held every startup command for the full 15-second timeout even though the real shell was up and prompting inside the relay's own pty. The shell-prompt readiness probe now detects that shape: when the direct identity check does not pass, it enumerates the foreground process's direct children and releases when one runs the expected shell from a legitimate install AND is foreground on its own tty AND that tty shows line-editor discipline. The sqlite3-style guard is preserved — no shell child, no release, same 15s timeout as today — and the marker fast path is untouched. Fixes stablyai#25586 Generated-by: GLM-5.3-Flash (ZCode)
A relay child listed by the first ps scan can exit before its own probes run; the resulting ps/readlink/realpath rejection aborted the whole child loop, so a valid relayed shell later in the list was never checked and the probe attempt was silently lost. Each child's probe sequence now skips on error, matching the existing missing-tty continue semantics. Generated-by: GLM-5.3-Flash (ZCode)
65a3070 to
5d6879c
Compare
|
Rebased onto current main to clear the conflict from #27729 (lsof non-blocking args). One rebase fallout needed a fix ( Verified: |
… execFile mock Rebase fallout from stablyai#27729: upstream added a smoke test that drives the real lsof, and the execFile mock in this file previously reset to a bare vi.fn(), so that test never resolved. The fallback wraps the real child process to the mock's callback convention ({ stdout }) because the source promisifies execFile and staged tests model the promisified result. Found by the rebase onto main; 9/9 in the suite.
…term relay (#33495) Release queued startup input when a figterm-style relay (Kiro CLI's kiro-cli-term) exec-replaces the shell: if the pane's foreground process isn't a shell, accept a direct child that is the expected shell, foreground on its own tty, at an editable prompt. Startup with Kiro shell integration drops from a 15s timeout to <1s. Fixes #25586 Supersedes #25899 Co-authored-by: ggbdpq <67929842+ggbdpq@users.noreply.github.com>
ELI5
If your shell startup files hook into Kiro CLI's terminal relay, every new Orca terminal or agent with a startup command sat frozen for exactly 15 seconds — the command only ran after a safety timeout expired, even though the shell was visibly up and prompting inside the relay. This PR teaches Orca's readiness probe to look one level deeper: when the process in front isn't the shell itself but a relay, Orca checks whether the relay's own shell child is real, legitimate, and prompting — and releases the command as soon as that's true (measured at ~0.3s instead of 15s).
What Changed
ShellPromptReadinessProbegains a relayed-shell branch. The direct path is byte-for-byte the old logic (outer tty is a line editor + foreground exe is the launched shell from a legitimate install). When that direct path does not pass, the probe enumerates the foreground process's direct children (ps -axo pid=,ppid=, bounded) and releases only when a childstatcontains+), andstty, via the existingparseLineEditorState).SessionShellReadyBarrierand the marker fast path are untouched. The generation/disposed invalidation checks wrap every new await. Normal shells (no relay) never run the extraps.Why
The barrier exists so injected commands never land in something that isn't a shell — the sqlite3 guard case (an exec-replaced REPL must not read our command as SQL) is load-bearing and its negative test stays. Kiro's relay breaks the direct check's premise: the foreground exe is the relay binary, and the real shell lives on the relay's inner pty. The three-part child check preserves the barrier's exact paranoia one level down — a child that is merely named zsh, or foreground but not in line-editor mode, still refuses. Setting
Q_TERM(the #24933-adjacent idea) was rejected because that issue explicitly wants Orca to not set it; this fix needs no environment changes.Linked Issue
Fixes #25586
Visual Proof
N/A for attached media in this environment (headless run), but the reproduction is real, not mocked: a new daemon-level integration test builds the reported shape with
script(1)— a.zprofilethatexecs a relayed inner zsh — and asserts the queued command is released and noshell-ready-timeoutis logged. Before the fix that case timed out waiting for output (the full 15s); after, it completes in ~0.3s.Testing
Commands actually run locally (macOS): the new integration case red before (PTY output wait timed out) / green after (271ms); the probe suite grew from 16 to 23 tests with zero changes to existing assertions (both relay shapes, inner-non-line-editor refusal, no-shell-child refusal, dispose invalidation, retry-cap); 13 related suites all green (daemon session/shell-ready 116 passed + 3 skipped, PTY startup delivery, agent-startup prompt latency, local PTY shell readiness, shared shell-process-readiness 44, process table, terminal host, relay pty launch 57);
pnpm tcexit 0;oxlint/oxfmt --checkclean on all four touched files. Real kiro-cli-term was not available — the relay structure was reproduced withscript(1)per the issue's own figterm-style framing, and both possible outer-tty states (lnext kept / lnext undefined) are covered by tests.AI Disclosure
Investigation, coding and verification by GLM-5.3-Flash (ZCode agent); orchestrated, reviewed and committed by a main agent with the same model, human overseeing.
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
macOS-verified; the tty-name mapping assumes the standard darwin/Linux layouts (
/dev/ttysNNN,/dev/pts/N— darwin tested, Linux is the standard shape). The relay branch adds at most 4 boundedpssweeps (~0.3s each, async) only when the direct check fails, so normal shells pay nothing. Cross-platform, SSH, and wire surfaces are untouched.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)