Repository navigation
test(agent-launch): keep the carry control on a prompt that still cannot ride the line after #23672 - #25734
Conversation
…not ride the line after #23672 #23672 quotes a multi-line PowerShell argument as one physical line, so the control's short multi-line prompt now rides the line on a Windows host that can prove the agent, and the unit shard went red. The control now uses a multi-line prompt over the typed budget, which still pastes, and a new test pins that a short multi-line prompt rides the PowerShell line as one physical line.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughThe Windows unproven-agent test now uses a 20-line prompt. A new Windows PowerShell test checks that a short multi-line prompt appears on one physical launch line, with newlines encoded as `n. Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to This change adds coverage for oversized and multiline Windows prompts without changing application behavior. No actionable merge risk is identified; routine validation remains. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 1 system. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
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. Comment |
ELI5
A unit test on main has been failing since two merged changes met. The test checks when a launch prompt rides the agent's command line and when it is pasted after the agent is ready. One case now gets a different answer, because PowerShell quoting changed. That is correct, so this PR updates the test. Nothing changes in the app.
What Changed
The problem. Main's unit shard has been red on
src/shared/startup-line-prompt-carry.test.ts› "on a host that cannot prove the launched agent is in front › carries a multi-line prompt on the launch line" since #23672 landed after #24257.`n,`r), instead of raw line breaks.For users: nothing changes. This is a test-only PR.
The change:
promptCarriedto be false. On a host that can't prove the agent, the same prompt still rides the line.`nin place of each line break.Byte-exactness of what now rides the line. I checked this by reading the code:
quoteStartupArgquotes a PowerShell argument withquotePowerShellLiteral(src/shared/tui-agent-startup-shell.ts:220-221).quotePowerShellMultilineLiteral(src/shared/powershell-native-argument.ts:2-3, 15-20). It escapes a backtick,$,", the typographic double quotes, CR and LF, and wraps the result in double quotes.`n/`rback into real LF/CR and the other escapes into the literal characters. The agent therefore gets the prompt's line breaks and text unchanged, as one argument; the native command-line split happens only on spaces and tabs outside quotes."when it builds a native command line. That applies equally to single-line prompts, which take the single-quoted path that has never escaped"for native arguments.Why
Flipping the control to
truewould have dropped what it tests: that a host which can prove the agent pastes a prompt the line can't carry. Choosing a prompt that still can't ride the line keeps that, and the new test records the behaviour #23672 introduced.Linked Issue
None. This fixes a red unit test on main.
Visual Proof
N/A: test-only change, nothing user-visible.
Testing
startup-line-prompt-carry.test.ts,tui-agent-startup.test.tsandpowershell-native-argument.test.ts: 98 tests pass.Ablation: with
quotePowerShellLiteral's multi-line branch disabled, which restores the pre-fix(terminal): submit startup commands with Enter on every platform #23672 raw line breaks, the new test fails and the control still passes.tc:nodepasses throughtc-gate. One caveat: main at dd39dcb was itself missing thecodexProviderHandleimport injournal-submission-positions.test.ts, so I added it in the working tree for that run only. It is not part of this PR.oxlint is clean on the changed file.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Review
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
Author: @BrennanKB5. Test-only. No impact on security, cross-platform behaviour, SSH, mobile or compatibility.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)