fix(cosh-ng): [shell] own prompt boundary#1310
Open
samchu-zsl wants to merge 2 commits into
Open
Conversation
Collaborator
Author
|
Caution This PR was generated and submitted by AI. |
Affected crate: crates/cosh-shell Cosh-shell now records its prompt boundary before running user PROMPT_COMMAND hooks, and card consumers run before the shell_busy early return. This fixes auth-style card input when prompt hooks leave the runtime thinking the foreground shell is busy. Known limitation: the dispatcher still has separate busy/non-busy paths for slash handling; this commit keeps the change scoped to interactive card consumers. Signed-off-by: Shenglong Zhu <samchu.zsl@alibaba-inc.com>
Affected crate: crates/cosh-shell Raw CLI assertions now focus on semantic behavior instead of exact renderer wording or environment-specific shell output. The tests cover card focus, provider handoff, host-executed shell results, startup prompt ghosts, and dev prompt hook noise. Known limitation: these are test-only hardening changes; they do not add a dedicated /auth raw_cli scenario. Signed-off-by: Shenglong Zhu <samchu.zsl@alibaba-inc.com>
88a7cb5 to
59d9274
Compare
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.
Description
Fixes a cosh-shell prompt boundary issue where user or system
PROMPT_COMMANDhooks could run before cosh recorded its prompt boundary, causing ghost foreground commands and leaving interactive cards stuck behindshell_busy. The shell marker now records cosh prompt state before running user prompt hooks, and interactive card consumers run before the busy early return. Raw CLI tests were hardened to assert semantic behavior across rich/plain rendering and dev shell environment differences.Related Issue
closes: #1249
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
cargo fmt --package cosh-shell -- --checkgit diff --check -- crates/cosh-shellcargo clippy --package cosh-shell --all-targets -- -D warningscargo test --package cosh-shell --test raw_cli -- --test-threads=4cargo test --package cosh-shell --test raw_cli host_executed::raw_cli_host_executed_provider_disconnect_marks_recovery_reason -- --exactNote: local
cargo test --package cosh-shell --libis blocked by macOS sandbox restrictions for readonly pipeline tests usingps; dev lib tests passed earlier.Additional Notes
The fix is scoped to
src/cosh-ng/crates/cosh-shell.