Skip to content

[PF-8] Run plan and implement in Cursor agent sandbox with streaming - #23

Merged
chucoding merged 2 commits into
developfrom
feature/PF-8
Mar 13, 2026
Merged

[PF-8] Run plan and implement in Cursor agent sandbox with streaming#23
chucoding merged 2 commits into
developfrom
feature/PF-8

Conversation

@chucoding

Copy link
Copy Markdown
Owner

Purpose

Run plan and implement in the Cursor agent sandbox (foreground) with streaming so that provider (Codex/Claude) logs stream in the same terminal and encoding issues in an external terminal are avoided.

Description

  • Plan mode streaming
    • cli-js: Codex runPlan now uses runCodexExecStreaming(fullPrompt, cwd, true); Claude runPlan uses runClaudeStreaming(fullPrompt, cwd) instead of execSync. Provider stdout/stderr stream to the agent terminal.
    • cli-py: Added _run_claude_streaming and _run_codex_exec_streaming; run_plan uses them so output streams to sys.stdout/sys.stderr via threads.
  • Implement mode sandbox (foreground)
    • .cursor/rules/workflow.mdc: Removed "start in the background" and "end the turn as soon as the process starts". Implement runs in the foreground; after completion, summarize result or report error.
    • .cursor/skills/i/SKILL.md: "Run the implement script in the background" → "Run the implement script" (foreground). Step 3: "After the command completes" — summarize or report error instead of ending the turn immediately.
  • Templates: Same changes applied to templates/cursor/rules/workflow.mdc and templates/cursor/skills/i/SKILL.md (and skill p if touched) for install sync.
Area Before After
Plan Buffered (spawnSync/execSync) or external terminal Streamed in agent sandbox terminal
Implement Run in background, turn ended immediately; often in external terminal (encoding issues) Run in foreground in agent sandbox; wait for completion then respond

How to test

  1. From the project root, run planforge plan "Add a README section" (or use /p in Cursor with a goal). Confirm that Codex or Claude output appears incrementally in the same terminal (no long silence until the end).
  2. Run planforge implement "Add a README section" (or use /i in Cursor). Confirm that the command runs in the same terminal, output streams, and the run completes before the agent replies (no "running in the terminal" early exit). Check that non-ASCII characters (e.g. Korean) in logs are not garbled.
  3. On Windows, run .cursor/skills/p/scripts/run_plan.ps1 "goal" and .cursor/skills/i/scripts/run_implement.ps1 "prompt" from the repo root and confirm behavior matches.

Review Requirement

  • Confirm that both Codex and Claude paths (cli-js and cli-py) use streaming for plan and that no plan-specific logic uses buffered run only.
  • Confirm workflow.mdc and SKILL (i) no longer mention "background" or "do not wait for completion" for implement.

Additional Info

  • Related Notion: cursor skill (design and implementation notes).
  • Branch: feature/PF-8.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@chucoding chucoding self-assigned this Mar 13, 2026
@chucoding
chucoding merged commit 150035c into develop Mar 13, 2026
1 check passed
@chucoding
chucoding deleted the feature/PF-8 branch March 13, 2026 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant