test(cosh-ng): [shell] route bare CJK after Insight - #3154
Draft
zhoukailong wants to merge 1 commit into
Draft
zhoukailong wants to merge 1 commit into
zhoukailong wants to merge 1 commit into
Conversation
Add a raw_cli regression test for the first acceptance item of agentic-os-org#3055: in a default (smart mode) Zsh session, a fake `make` build failure surfaces a real Insight, and the two consecutive bare CJK prompts submitted afterwards must still route to the Agent. The marker-gated harness drives `raw fake --shell zsh` with zero sleeps: wait for the prompt, run `make all`, wait for the Insight line, then submit the two distinct CJK prompts. Assertions verify the Insight text precedes both distinct `Received shell prompt request:` lines emitted by the fake adapter (terminal echo cannot forge these), that no `command not found` appears, and the child exits cleanly via the harness status assertion. The existing zsh availability guard defers mandatory coverage to the amd64 Anolis gate. Refs agentic-os-org#3055 Assisted-by: Codex:0.152.1 Signed-off-by: OmniSolve <324835893+zhoukailong@users.noreply.github.com>
7 tasks
This branch has not been deployed
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.
Why
GitHub issue #3055 reports intermittent loss of Agent routing for bare CJK natural-language prompts. The issue's observation matrix shows the sequence "failed command shows Insight, then
测试and继续测试" currently passes on main, but no existing test covers the combined sequence (real Insight → two consecutive bare CJK prompts → both reach the Agent) in a default Zsh session. This PR is a partial slice: regression test for the first acceptance item only — it locks in known-good default behavior and does not attempt to fix the intermittent incident or implement the diagnostic proposal.What changed
src/cosh-ng/crates/cosh-shell/tests/raw_cli/failed_command.rs: append one#[test],raw_cli_zsh_insight_keeps_bare_cjk_natural_language_routing_to_agent(+63 lines, test-only).cosh-shell raw fake --shell zshthrough the existing zero-sleep, marker-gated harness with an isolated HOME and a fakemakethat fails with exit code 2: wait for prompt →make all→ wait for the real Insight line → submit测试→ wait forReceived shell prompt request: 测试→ submit继续测试→ wait for its request line →exit.Received shell prompt request:lines (emitted by the fake adapter when the Agent receives the request — terminal echo cannot forge them), nocommand not foundoutput, and clean child exit (harness status assertion).src/) code, public API, or documentation changes.Related issue
Refs #3055 (partial slice — first acceptance item only; does not close the issue)
User / Agent impact
None. Test-only addition; no runtime behavior change.
Risk and compatibility
Low risk: pure test append in an existing integration test file.
Validation
Environment: Linux x86_64, Rust 1.96.0, base
80301fb9e4a9fa047f95e8c943b1db1884c0b9af.cargo fmt --all -- --check→ exit 0.cargo clippy --locked -p cosh-shell --test raw_cli -- -D warnings→ exit 0, no warnings.cargo test --locked -p cosh-shell --test raw_cli failed_command::raw_cli_build_failure_respects_analysis_mode_matrix -- --exact→ 1 matched, 1 passed (real execution).cargo test --locked -p cosh-shell --test raw_cli failed_command::raw_cli_natural_language_after_failure_does_not_bind_generic_failure -- --exact→ 1 matched, 1 passed (real execution).agent_input::raw_cli_zsh_shell_arg_intercepts_fragmented_natural_language,failed_command::raw_cli_zsh_generic_failure_restores_prompt_without_insight): compile and run, but the local runtime has nozsh, so each exits through the existing availability guard ("zsh unavailable; mandatory coverage runs in the amd64 Anolis gate") — recorded as env-blocked, not counted as passed. The authoritative zsh execution evidence is the CI amd64 Anolis gate.Documentation and rollback
No documentation changes. Rollback: revert the single commit (pure test addition, no production coupling).