Skip to content

Studio Code: Drop the payload-limit prose the Write, Edit and Bash refusals already carry - #5162

Merged
chubes4 merged 1 commit into
trunkfrom
studio-code/prompt-drop-payload-prose
Oct 16, 2026
Merged

chubes4 merged 1 commit into
trunkfrom
studio-code/prompt-drop-payload-prose

Conversation

@chubes4

@chubes4 chubes4 commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Related issues

How AI was used in this PR

Claude (via the Pi coding agent in a Roadie session) went through the system prompt rule by rule looking for rules a tool can enforce, then wrote the change and its tests and ran the checks below. Opened as a draft for human review.

Proposed Changes

  • The Working cadence section listed the Write, Edit and Bash payload limits and warned against heredocs and Python scripts. The tools already enforce all of this: an oversized call is refused, and the refusal says how to split the work (a skeleton plus Edit calls) and not to fall back to heredocs or scripts.
  • That prompt text is removed, cutting the prompt by about 340 characters. The ~8KB-per-Edit target the agent actually uses is in the block-content skill's recipes, where the long files are written.
  • STUDIO_EDIT_CALL_TARGET_BYTES was only used by that text, so it is removed too.

Testing Instructions

  • npx vitest run apps/cli/ai passes. The pi runtime tests still check that oversized Write, Edit and Bash calls are refused.

Targeted eval (one prompt asking for a ~24 KB plugin file, judged on the resulting site): with this change merged alongside #5163–#5165, the first oversized Write was refused on every run, and the agent built the file with smaller edits, as on trunk. Pass rate matched trunk (1/2 on each arm; the failing run on both arms is the same assertion issue, unrelated to this change).

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

@wpmobilebot

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing 77f7a3e vs trunk

app-size

Metric trunk 77f7a3e Diff Change
App Size (Mac) 930.76 MB 930.72 MB 0.04 MB ⚪ 0.0%

site-editor

Metric trunk 77f7a3e Diff Change
load 1230 ms 1144 ms 86 ms 🟢 -7.0%

site-startup

Metric trunk 77f7a3e Diff Change
siteCreation 8565 ms 8581 ms +16 ms ⚪ 0.0%
siteStartup 5894 ms 5897 ms +3 ms ⚪ 0.0%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

@chubes4
chubes4 merged commit 0f7c08b into trunk Oct 16, 2026
14 checks passed
@chubes4
chubes4 deleted the studio-code/prompt-drop-payload-prose branch October 16, 2026 23:35
chubes4 added a commit that referenced this pull request Oct 16, 2026
…#5165)

## Related issues

- Related to #5146: one of a series of small changes that move system
prompt rules into tool structure

## How AI was used in this PR

Claude (via the Pi coding agent in a Roadie session) went through the
system prompt rule by rule looking for rules a tool can enforce, then
wrote the change and its tests and ran the checks below. Opened as a
draft for human review.

## Proposed Changes

- In a terminal session, the prompt carried a paragraph saying the user
may not see screenshots, so the agent should not reply as if they had
("Here's your site!").
- `take_screenshot` now states that fact in its result, at the moment it
matters: "The user does not see this capture: the terminal shows them
only the saved file path." The desktop app (which shows the capture) and
MCP clients (which get image links to show) don't get the line.
- The paragraph is removed from the prompt, cutting the terminal prompt
by about 420 characters.

## Testing Instructions

- `npx vitest run apps/cli/ai/tests/tools.test.ts -t "saved file path"`
checks which sessions get the line.

Targeted eval ("Take a screenshot of this site's homepage and show it to
me", run in the terminal, judged on the final reply): with this change
merged alongside #5162–#5164, the agent took the screenshot and pointed
the user to the saved file on 2/2 runs, and never claimed the image was
shown. This matches trunk (2/2) without the prompt rule.

## Pre-merge Checklist

- [ ] Have you checked for TypeScript, React or other console errors?
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.

2 participants