Skip to content

test(agent-launch): keep the carry control on a prompt that still cannot ride the line after #23672 - #25734

Merged
brennanb2025 merged 2 commits into
mainfrom
brennanb2025/carry-test-control-after-23672
Oct 6, 2026
Merged

brennanb2025 merged 2 commits into
mainfrom
brennanb2025/carry-test-control-after-23672

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​14 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​13
Prod 0 0 0 0

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.

For users: nothing changes. This is a test-only PR.

The change:

  • The control keeps testing what it was written to test: a prompt that still can't ride the line on that host gets pasted. It now uses a multi-line prompt over the typed budget (20 lines of 40 bytes, about 820 bytes even in PowerShell's one-line form), and still expects promptCarried to be false. On a host that can't prove the agent, the same prompt still rides the line.
  • A new test pins fix(terminal): submit startup commands with Enter on every platform #23672's effect: on a Windows PowerShell host, a short multi-line prompt now rides the launch line. The line contains no CR or LF, and the prompt appears with `n in place of each line break.

Byte-exactness of what now rides the line. I checked this by reading the code:

  • quoteStartupArg quotes a PowerShell argument with quotePowerShellLiteral (src/shared/tui-agent-startup-shell.ts:220-221).
  • A value with CR or LF goes to 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.
  • PowerShell turns `n/`r back 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.
  • One limit is unchanged by fix(terminal): submit startup commands with Enter on every platform #23672: Windows PowerShell 5.1 drops embedded " 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 true would 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.ts and powershell-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:node passes through tc-gate. One caveat: main at dd39dcb was itself missing the codexProviderHandle import in journal-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

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and 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

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

…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.
@brennanb2025
brennanb2025 marked this pull request as ready for review October 6, 2026 00:59
@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 10da4cf5-57b0-4b6d-a288-b93a22ea287b
📥 Commits

Reviewing files that changed from the base of the PR and between 9756dae and 3dd3125.

📒 Files selected for processing (1)
  • src/shared/startup-line-prompt-carry.test.ts

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


📝 Walkthrough

Walkthrough

The 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 9eaf8

This change adds coverage for oversized and multiline Windows prompts without changing application behavior. No actionable merge risk is identified; routine validation remains.

Architecture Summary

Architecture risk: 🔵 Low · up to 3dd31

The change affects 1 system.

Changed systems: src

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — src (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in src/shared/startup-line-prompt-carry.test.ts: The unproven-agent Windows case now tests a 20-line prompt instead of a 5-line prompt; its comment states that the prompt exceeds the typed budget even in PowerShell’s one-line form.
  • observed — Modified behavior in src/shared/startup-line-prompt-carry.test.ts: Adds a Windows PowerShell test expecting a short multi-line prompt to be carried on the launch line as one physical line, with prompt newlines represented by `n.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the test change: preserving the carry-control case after the PowerShell quoting change. It is specific, though longer than necessary.
Description check ✅ Passed The description is detailed and covers the change, reason, testing, and test-only impact. It marks visual proof as not applicable. It lists no linked issue; the template requires one for outside contr…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
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.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Comment @coderabbitai help to get the list of available commands.

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