Skip to content

improvement(pi): prompting to ensure harness knows push is deterministic#5180

Merged
icecrasher321 merged 1 commit into
stagingfrom
improvement/pi-prompting
Jun 23, 2026
Merged

improvement(pi): prompting to ensure harness knows push is deterministic#5180
icecrasher321 merged 1 commit into
stagingfrom
improvement/pi-prompting

Conversation

@icecrasher321

Copy link
Copy Markdown
Collaborator

Summary

Prompting improvement to ensure Pi agent knows that git push is done by our deterministic sandbox runner.

Type of Change

  • Other: Prompting

Testing

Tested manuallu

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Jun 23, 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)
docs Skipped Skipped Jun 23, 2026 5:13am

Request Review

@cursor

cursor Bot commented Jun 23, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Prompt-only changes to Pi agent instructions; no changes to git push, sandbox, or execution flow.

Overview
Adds optional operating instructions to Pi prompts so the harness matches how Sim finishes each run, instead of the agent trying git push, PR creation, or full test runs on its own.

buildPiPrompt now accepts optional guidance, emitted first as # Operating instructions before skills, memory, and the task. Cloud mode passes CLOUD_GUIDANCE: file edits only; no git/GitHub/PR; Sim commits, pushes, and opens the PR; do not depend on project tooling in the sandbox. Local mode passes LOCAL_GUIDANCE: use SSH repo tools only; no commit/push/PR so changes stay in the working tree for Sim’s diff capture.

Reviewed by Cursor Bugbot for commit 83d101b. Configure here.

@greptile-apps

greptile-apps Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds mode-specific operating instructions (CLOUD_GUIDANCE and LOCAL_GUIDANCE) to the Pi agent's prompt, prepended before skills, memory, and the task. The goal is to prevent the agent from attempting git operations (commit, push, PR creation) or running the build/test toolchain in environments where those operations are unavailable or would break the harness's deterministic flow.

  • context.ts extends buildPiPrompt with an optional guidance field placed at the top of the rendered prompt under # Operating instructions.
  • cloud-backend.ts defines CLOUD_GUIDANCE covering no-git, no-credentials, no-PR constraints; local-backend.ts defines LOCAL_GUIDANCE scoped to leaving changes in the working tree.

Confidence Score: 5/5

Safe to merge — changes are entirely additive prompt strings with no logic alterations.

Both guidance constants are append-only strings injected at the top of an existing prompt builder. The guidance field is optional and backward-compatible, existing tests mock buildPiPrompt entirely so they are unaffected, and the two backends that call the function are both updated consistently.

No files require special attention.

Important Files Changed

Filename Overview
apps/sim/executor/handlers/pi/context.ts Extends buildPiPrompt with an optional guidance field; guidance is prepended as the first section of the prompt, before skills and memory — correct ordering for system-level constraints.
apps/sim/executor/handlers/pi/cloud-backend.ts Adds CLOUD_GUIDANCE constant instructing the agent not to run git operations or build tooling, and passes it into buildPiPrompt; change is minimal and well-commented.
apps/sim/executor/handlers/pi/local-backend.ts Adds LOCAL_GUIDANCE instructing the agent to leave working-tree changes uncommitted; passes it into buildPiPrompt alongside the existing task/skills/memory inputs.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant Sim as Sim Harness
    participant Pi as Pi Agent
    participant FS as File System
    participant GH as GitHub

    Sim->>Pi: buildPiPrompt(guidance + skills + memory + task)
    Note over Pi: Reads "# Operating instructions":<br/>do NOT git commit/push/open PR
    Pi->>FS: read/write/edit file changes only
    Pi-->>Sim: run complete (working tree dirty)
    Sim->>GH: git commit + push + open PR
    GH-->>Sim: PR URL
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant Sim as Sim Harness
    participant Pi as Pi Agent
    participant FS as File System
    participant GH as GitHub

    Sim->>Pi: buildPiPrompt(guidance + skills + memory + task)
    Note over Pi: Reads "# Operating instructions":<br/>do NOT git commit/push/open PR
    Pi->>FS: read/write/edit file changes only
    Pi-->>Sim: run complete (working tree dirty)
    Sim->>GH: git commit + push + open PR
    GH-->>Sim: PR URL
Loading

Reviews (1): Last reviewed commit: "improvement(pi): prompting to ensure har..." | Re-trigger Greptile

@icecrasher321 icecrasher321 merged commit ccc6954 into staging Jun 23, 2026
16 checks passed
@icecrasher321 icecrasher321 deleted the improvement/pi-prompting branch June 23, 2026 05:19
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