Skip to content

test(terminal): preserve Bash prompt suffixes and array order - #34732

Open
kaluli123123 wants to merge 2 commits into
stablyai:mainfrom
kaluli123123:fix/omp-20261028-bash-prompt-regression
Open

kaluli123123 wants to merge 2 commits into
stablyai:mainfrom
kaluli123123:fix/omp-20261028-bash-prompt-regression

Conversation

@kaluli123123

@kaluli123123 kaluli123123 commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

Keep real Bash coverage for the prompt-hook separators and ordering that previously broke shell integration. Current main already contains the production implementation; this branch changes tests only.

What Changed

Execute the production rcfile with a temporary HOME/profile, covering trailing separators, consecutive separators, escaped semicolons/spaces, and array member order. Assert that user hooks run before the epilogue and array members execute once.

This is the focused bash-prompt-regression contribution split from #14838 following the maintainer request. It is based on main ee09f979fac61fc5b1db4a528c9e3a20667b796f. No unrelated contribution from the original PR is included.

Why

Keeping this boundary separate gives the fix its own cause, verification scope and rollback boundary without adding dependencies or changing unrelated features.

Linked Issue

#14448

Visual Proof

N/A — coverage-only split, no production or visual behavior change.

Testing

  • I manually tested these changes locally — no human testing attestation is made.
  • Automated tests added/updated.

ORCA_BACKGROUND_LAUNCH=1 pnpm check:changed --base=ee09f979fac61fc5b1db4a528c9e3a20667b796f --maxWorkers=2: 19/19 checks passed (47.7 seconds in the required wrapper).

Actual standalone production rcfile smoke: Bash exited 0; a trailing separator preserved the user hook before the epilogue, and array prompt hooks ran once in order. No full daemon/PTY/native-platform result is claimed.

Required check:changed passed all 19 checks. A separate actual Bash smoke passed trailing-separator and ordered-array behavior using the generated production rcfile.

Full repository regression/native packaging, real cross-platform/SSH/paired-host interaction and successful exact-head PR Checks remain separate gates; they are not claimed passing by this split.

Risk

Level: Low

This is tests-only. A flaky interactive Bash fixture could delay validation on a different shell or host; production prompt handling, saved data, agent selection, and SSH transport are unchanged. Revert the test change to remove the coverage; there is no data migration to undo.

AI Disclosure

OpenAI Codex GPT-6.1-Sol assisted with this maintenance split, integration, regression coverage and verification. Original contribution and review history is retained in #14838.

Review

  • Correctness: the focused behavior and failure boundaries are covered as described above; no full-suite claim.
  • Cross-platform and remote/local: shared behavior is preserved; only the stated macOS execution evidence is established. Real Windows/Linux/SSH/paired-host behavior remains unverified unless explicitly listed.
  • Agent/integration compatibility: no agent selection or integration configuration is changed by this split.
  • Performance and security: no new dependency, credential access or network authority is introduced; ownership checks fail closed and parser matching stays limited to known shapes where applicable.
  • UI quality: no styling/layout change; no native visual-quality claim.

Agent skill upstream boundary

  • Not applicable: no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments or documentation are copied or mechanically translated.

Checklist

  • This PR is small and focused.
  • The before/after, mechanism and rationale are explained.
  • Visual applicability and evidence boundaries are explicit.
  • Self-reviewed for correctness, security and performance.
  • Cross-platform, SSH/remote and path/shortcut impact considered.
  • Full lint/typecheck/test/build and exact-head CI are all green — only the specific checks above are established.

Author

  • X / Twitter: N/A

Split the remaining independent contribution from stablyai#14838 as requested by the maintainer.
@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Walkthrough

Added Bash integration tests for the shell-ready rcfile. The tests run on non-Windows systems when Bash is available. They check separator and escape handling in PROMPT_COMMAND, and verify that array-form commands run once and in order before the epilogue.

Merge Risk: Minimal · up to bbd8f

This test-only change has no established merge-blocking risk.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly and concisely describes the test-only change: preserving Bash prompt suffixes and array execution order.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The pull request description follows the required template and clearly states the scope, user-facing behavior, rationale, linked issue, testing evidence, risk, rollback method, AI disclosure, and plat…
Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 1 files.

Full details: Description check

Explanation

The pull request description follows the required template and clearly states the scope, user-facing behavior, rationale, linked issue, testing evidence, risk, rollback method, AI disclosure, and platform limitations. It explicitly marks visual proof as not applicable and does not claim unverified full-suite or cross-platform results.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Tip

🎯 Customize your risk assessments

Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

✅ Automatic approvals, with your rules

Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 68ed04a2-0423-4dc2-b7ba-b28d0b1d1b49
Commits

Reviewing files that changed from the base of the PR and between 19f3b24 and bbd8f55.

Files selected for processing: 1
  • src/main/daemon/daemon-bash-shell-ready-rcfile.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@coderabbitai coderabbitai Bot 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.

Nitpick comments: 1
src/main/daemon/daemon-bash-shell-ready-rcfile.test.ts: 1

61-72: Trivial · Functional Correctness · Quick win

Assert that array hooks run before the epilogue.

Yes. The array test checks counts and member order only. A regression that runs the epilogue first would pass it. Define the observable epilogue in this fixture and assert that ARRAY_SECOND precedes it.

Suggested fix
       `PROMPT_COMMAND=('printf "ARRAY_FIRST\\n"' 'printf "ARRAY_SECOND\\n"')`,
-      '',
+      String.raw`__orca_osc133_epilogue() { printf "EPILOGUE_RAN\n"; }`,
       'exit 0\n'
     )

     expect(output.match(/ARRAY_FIRST/g)).toHaveLength(1)
     expect(output.match(/ARRAY_SECOND/g)).toHaveLength(1)
     expect(output.indexOf('ARRAY_FIRST')).toBeLessThan(output.indexOf('ARRAY_SECOND'))
+    expect(output.indexOf('ARRAY_SECOND')).toBeLessThan(output.indexOf('EPILOGUE_RAN'))

Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 18170055-2e50-471d-9842-ee44eefce067
Commits

Reviewing files that changed from the base of the PR and between 32a5085 and 19f3b24.

Files selected for processing: 1
  • src/main/daemon/daemon-bash-shell-ready-rcfile.test.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.

@kaluli123123

kaluli123123 commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor Author

Addressed the array-epilogue coverage gap in bbd8f55. The real Bash array fixture now installs an observable epilogue, checks that it ran, and requires ARRAY_SECOND to precede it while retaining exact-once and member-order assertions.

Current-head update: bbd8f553ff93379b8721881faf221d949182b2b0 now passed all 19 required check:changed --base=ee09f979fac61fc5b1db4a528c9e3a20667b796f --maxWorkers=2 checks (48.9 s), in addition to the two actual interactive Bash regression tests. One earlier wrapper attempt included the generated Vitest JSON report as an untracked input and failed formatting; that task-owned generated report was archived outside the worktree and removed before the clean 19/19 run. CI and maintainer review remain separate gates.

This branch has not been deployed

No deployments
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.

1 participant