Skip to content

Cursor Pty Brain Flaps#565

Merged
arul28 merged 2 commits into
mainfrom
ade/cursor-pty-brain-flaps-cdd125fe
Jun 12, 2026
Merged

Cursor Pty Brain Flaps#565
arul28 merged 2 commits into
mainfrom
ade/cursor-pty-brain-flaps-cdd125fe

Conversation

@arul28

@arul28 arul28 commented Jun 12, 2026

Copy link
Copy Markdown
Owner

Summary

Describe the change.

What Changed

Key files and behaviors.

Validation

How you tested.

Risks

Anything to watch.

ADE   Open in ADE  ·  ade/cursor-pty-brain-flaps-cdd125fe branch  ·  PR #565

Greptile Summary

This PR changes how Cursor CLI sessions receive their initial prompt: instead of embedding the prompt (and ADE guidance) as a trailing command-line argument to cursor-agent, the text is now submitted through PTY input after the interactive CLI is ready, with a 750 ms readiness delay. Empty Cursor launches no longer auto-submit ADE guidance as the first turn.

  • cliLaunch.ts: The Cursor branch of buildTrackedCliLaunchCommand drops the prompt from args and conditionally sets initialInput/initialInputDelayMs: 750 only when an initialPrompt is present; empty launches produce a clean idle session.
  • Tests (cliLaunch.test.ts, adeRpcServer.test.ts, syncRemoteCommandService.test.ts, AgentChatPane.test.tsx): All relevant assertions flipped from checking prompt membership in args to checking initialInput/initialInputDelayMs, and a new test case covers the empty-launch idle path.
  • Docs: README.md, pty-and-processes.md, and ui-surfaces.md updated to describe the new launch strategy and the selective ADE guidance injection for Cursor.

Confidence Score: 5/5

Safe to merge; the fresh-launch path for Cursor is cleanly implemented and thoroughly tested across all relevant test suites.

All changed test assertions are consistent with the implementation. The one area worth a follow-up is whether buildTrackedCliResumeCommand for Cursor (unchanged in this PR) also needs to stop appending the prompt to args, given the docs now describe that path as prompt-free — but that is a documentation/code alignment question for the resume path, not a defect in the fresh-launch change being shipped here.

The resume branch for Cursor in buildTrackedCliResumeCommand (cliLaunch.ts lines 803–819) may be worth a follow-up to confirm it aligns with the updated docs.

Important Files Changed

Filename Overview
apps/desktop/src/shared/cliLaunch.ts Core behavior change: Cursor fresh launches no longer embed the initial prompt (or ADE guidance) in argv; instead, when an initialPrompt is present it is submitted via PTY input with a 750 ms delay. Empty launches remain idle. Resume path (buildTrackedCliResumeCommand for cursor) still appends prompt to args, which may be inconsistent with the updated docs.
apps/desktop/src/renderer/components/terminals/cliLaunch.test.ts Tests updated to match new PTY-input behavior: assertions flip from checking prompt in args to checking initialInput/initialInputDelayMs; new test case added for empty Cursor launches staying idle.
apps/ade-cli/src/adeRpcServer.test.ts Test description and assertions updated to reflect that Cursor initial input is now submitted via PTY (initialInput/initialInputDelayMs) rather than as the last command-line argument.
apps/desktop/src/main/services/sync/syncRemoteCommandService.test.ts Test updated analogously to adeRpcServer.test.ts — assertions now verify PTY-input delivery of the initial prompt for Cursor sessions launched via the sync remote command service.
apps/desktop/src/renderer/components/chat/AgentChatPane.test.tsx AgentChatPane tests updated: fast-mode and medium-thinking Cursor launches now assert prompt is in initialInput (not args), consistent with the new PTY-input delivery.
docs/features/terminals-and-sessions/README.md Documentation accurately updated to describe the new Cursor launch strategy: direct cursor-agent invocation, idle on empty launch, PTY submission of ADE guidance + user prompt only when an initial prompt exists.
docs/features/terminals-and-sessions/pty-and-processes.md Docs now state Cursor's continuation command is prompt-free (text submitted via PTY), but the code in buildTrackedCliResumeCommand for cursor still conditionally appends the prompt to argv — the resume path may not fully match this description.
docs/features/terminals-and-sessions/ui-surfaces.md UI surfaces doc updated to reflect Cursor's new launch strategy and the selective ADE guidance injection.

Sequence Diagram

sequenceDiagram
    participant ADE as ADE Runtime
    participant Builder as buildTrackedCliLaunchCommand
    participant PTY as PTY Service
    participant Cursor as cursor-agent process

    ADE->>Builder: "provider="cursor", initialPrompt?"

    alt initialPrompt present
        Builder-->>ADE: "{ args:[--mode,--model,...], initialInput:"ADE guidance\nUser prompt", initialInputDelayMs:750 }"
        ADE->>PTY: "create(command="cursor-agent", args, initialInput, initialInputDelayMs=750)"
        PTY->>Cursor: spawn cursor-agent [--mode] [--model]
        Cursor-->>PTY: interactive prompt ready
        PTY->>Cursor: write initialInput after 750ms delay
    else no initialPrompt (empty launch)
        Builder-->>ADE: "{ args:[--model,...] } — no initialInput"
        ADE->>PTY: "create(command="cursor-agent", args)"
        PTY->>Cursor: spawn cursor-agent [--model] — idle, awaits user
    end
Loading

Reviews (2): Last reviewed commit: "Fix Cursor Work draft launch tests" | Re-trigger Greptile

@vercel

vercel Bot commented Jun 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
ade Ignored Ignored Preview Jun 12, 2026 7:46pm

@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@arul28, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 20 minutes and 21 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 8bc895d6-68db-4a68-b4e1-813d5fef4cda

📥 Commits

Reviewing files that changed from the base of the PR and between 49efe29 and 3addb56.

⛔ Files ignored due to path filters (3)
  • docs/features/terminals-and-sessions/README.md is excluded by !docs/**
  • docs/features/terminals-and-sessions/pty-and-processes.md is excluded by !docs/**
  • docs/features/terminals-and-sessions/ui-surfaces.md is excluded by !docs/**
📒 Files selected for processing (5)
  • apps/ade-cli/src/adeRpcServer.test.ts
  • apps/desktop/src/main/services/sync/syncRemoteCommandService.test.ts
  • apps/desktop/src/renderer/components/chat/AgentChatPane.test.tsx
  • apps/desktop/src/renderer/components/terminals/cliLaunch.test.ts
  • apps/desktop/src/shared/cliLaunch.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ade/cursor-pty-brain-flaps-cdd125fe

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 and usage tips.

@arul28

arul28 commented Jun 12, 2026

Copy link
Copy Markdown
Owner Author

@copilot review but do not make fixes

@mintlify

mintlify Bot commented Jun 12, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
ade-ac1c6011 🟢 Ready View Preview Jun 12, 2026, 7:41 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@arul28

arul28 commented Jun 12, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 3addb56b5c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@arul28 arul28 merged commit c4765c7 into main Jun 12, 2026
27 checks passed
@arul28 arul28 deleted the ade/cursor-pty-brain-flaps-cdd125fe branch June 12, 2026 19:52
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