Skip to content

feat: relay prompt minimisation (-31% static chars per request) - #15

Open
Shifat7 wants to merge 1 commit into
clutchpbcfo:mainfrom
Shifat7:pr-08-relay-prompt-minimisation
Open

Shifat7 wants to merge 1 commit into
clutchpbcfo:mainfrom
Shifat7:pr-08-relay-prompt-minimisation

Conversation

@Shifat7

@Shifat7 Shifat7 commented Aug 22, 2026

Copy link
Copy Markdown

What changed

The bridge repeated ~21 lines of static behavioural prose in every sampling request. It now sends the short, mechanical minimum that survives imperfect relay-agent setup:

  • ownership boundary (Codex owns files/shell/patches/approvals);
  • forwarded tool list;
  • the four exact JSON shapes (verbatim — these are load-bearing for reliability);
  • never-invent-names + one-JSON-object rules.

Durable behavioural rules move to the relay agent's system prompt: RELAY_AGENT_PROMPT.md now explicitly documents itself as that home, and the README documents the recommended agent setup.

Measured locally

Trivial one-turn request with one tool:

Before: 1,978 prompt chars
After:  1,370 prompt chars (-31%)

Applied to every request of every tool loop.

Reliability guardrails (test-pinned)

A regression test asserts the minimised prompt still contains every reliability-critical phrase (tool list line, JSON-only rule, all four shapes, never-invent-names). The full parse-robustness suite and Codex SSE compatibility tests pass unchanged; npm test: 76 pass, 0 fail.

Collapse the relay header from 21 lines of prose to the mechanical
minimum that survives imperfect relay-agent setup: ownership boundary,
forwarded tool list, four JSON shapes, never-invent-names, and
one-JSON-object rules. Trivial-prompt size drops from 1,978 to 1,370
chars (-31%), applied to every sampling request.

Documented the recommended relay agent setup in README and marked
RELAY_AGENT_PROMPT.md as the durable home for behavioural rules.
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