feat(harness): give the base prompt Codex's adaptive brevity default - #280
Conversation
The base prompt asked only for a "short" final message, which leaves
user-visible answer length to model default. On one live Sol session that
meant a 506-token median output against 73 fleet-wide, with stream p50
17.4s against 0.5s; TTFT was only ~2.6s slower, so the cost was in visible
response generation rather than latency to first token.
Replace that line with one paragraph tracking Codex's own wording from
codex-rs/core/gpt_5_2_prompt.md: its Personality section ("concise, direct,
and friendly", "keeping the user clearly informed about ongoing actions
without unnecessary detail") and its Presenting-your-work brevity rule
("no more than 10 lines, but can relax this requirement for tasks where
additional detail and comprehensiveness is important for the user's
understanding").
The ceiling is adaptive on purpose. OpenCode's fewer-than-four-lines,
one-word-answers-preferred rule was rejected: a public model-vendor report
finds that overly aggressive brevity can suppress planning and coding
quality on reasoning models. The exception here also names correctness,
security, and review findings, so the paragraph cannot be read as licence
to skip investigation, tests, blockers, or necessary context.
Scope: user-visible prose only. The pre-tool progress sentence and the
findings-first review line are untouched, and project instructions override
this as they already did. The file-path reference rule is carried into the
new paragraph rather than dropped.
baseBehaviorGuidance goes from 19 lines/256 words to 19 lines/298 words,
inside the existing 25-line/300-word budget. The prompt grows so that the
answers do not.
Red-verified on main: the new contract test failed on the missing
"concise, direct, and friendly" and "10 lines" strings and on the absent
relax-exception. It also asserts the absence of a second, tighter cap.
There was a problem hiding this comment.
🟢 Approval recommended
The prompt change is narrowly scoped, internally consistent with the existing guidance block, and is backed by a focused regression test.
Pull request overview
This PR updates harness’s base system prompt behavior guidance to make “brevity” actionable (defaulting to a 10-line ceiling with explicit exceptions), aiming to reduce user-visible output length and streaming time while preserving correctness and necessary detail.
Changes:
- Replaced the prior “keep your final message short” instruction with a more specific “concise, direct, and friendly” paragraph, including a default 10-line limit and a relax/exception clause.
- Added a targeted test to pin the adaptive brevity default (including the absence of tighter OpenCode-style caps) and retention of the “reference a file path” rule.
File summaries
| File | Description |
|---|---|
| cmd/harness/main.go | Updates baseBehaviorGuidance() to include an actionable adaptive brevity instruction and “do not repeat tool output.” |
| cmd/harness/main_test.go | Adds TestBaseBehaviorGuidanceSetsAnAdaptiveBrevityDefault to lock in the intended brevity defaults and guard against regressing to vague or overly strict caps. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Live Codex A/B completed from a credentialed box; the report’s “dummy credential means no probe” limitation does not apply here because gatekeeper injects the real ChatGPT credential. Method: built current
TTFT was essentially unchanged/noisy (complex median 6.61s → 6.14s), as expected: this targets output generation, not prefill. All candidate outputs preserved the diagnosis, measurements, fix, verification, and three incomplete follow-ups. They exceeded 10 lines on the complex prompt because the adaptive exception applied; the rule reduced prose without forcing material detail out. Conclusion: directional evidence supports the change. It does almost nothing to an answer already concise, while reducing a complex handoff’s median visible size by ~25% and stream time by ~27%. Samples are small and not a quality benchmark, so fleet |
Problem
baseBehaviorGuidance()said only:"Short" is not actionable, so user-visible answer length fell back to model default. On one live Sol session:
TTFT barely moved, so the cost is in visible response generation — not latency to first token, tools, or hidden reasoning. That is what this targets.
Change
One paragraph, replacing that one line:
Codex comparison
The reference paths in the original brief are stale —
codex-rs/core/prompt.md404s, and the prompts are now versioned per model (gpt_5_2_prompt.md,gpt-5.2-codex_prompt.md, …). I read the current source. The prose above tracks two places incodex-rs/core/gpt_5_2_prompt.md:Deliberately not imported: Codex's whole final-answer style guide (headers, bullet counts, monospace rules, file-reference grammar). This is one paragraph adapted to harness's existing terse list, not a style guide.
Why not OpenCode's rule
OpenCode prefers fewer than four lines and one-word answers. Rejected: a public model-vendor report finds overly aggressive brevity can suppress planning and coding quality on reasoning models. Codex's adaptive ceiling is the target instead — hence the explicit
relaxclause, which also names correctness, security, and review findings so the paragraph cannot be read as licence to skip investigation, tests, blockers, or necessary context.Scope
Budget
Line count unchanged; +42 words, 2 under the cap. So any wording request here needs to be a swap, not an addition — or the budget test fails, which is what it is for. The prompt grows so that the answers do not.
Tests
TestBaseBehaviorGuidanceSetsAnAdaptiveBrevityDefaultpins the durable behavior rather than the paragraph byte-for-byte:concise, direct, and friendlydefault;10 linesceiling that makes it actionable;relaxexception, so the ceiling is adaptive rather than absolute;4 lines,four lines,one-word,single word) — the OpenCode shape this rejects;file pathrule.Red-verified on current main: fails on the missing
concise, direct, and friendlyand10 linesstrings and on the absent relax-exception.TestBaseBehaviorGuidanceStaysUnderBudgetandTestSystemPromptCarriesBaseBehaviorGuidancestill pass unchanged.go test -race ./cmd/harness/thengo test -race ./...green;go build,go vet,gofmtclean.Live A/B (run from a credentialed box)
I could not run this myself — only a dummy credential (
CODEX_DUMMY_KEY) is present on my box. It was run separately on a box where gatekeeper injects the real ChatGPT credential:mainand this head built as separate clean binaries, arms alternated to reduce ordering bias, samecodex/gpt-5.6-sol, fresh no-save session per call,-no-instructions, identical prompt within each workload. Metrics from each binary's ownturn_metrics; visible counts from stdout.Two results matter more than the deltas:
relaxexception applied. That is the direct answer to the OpenCode-brevity risk this PR cites.TTFT was unchanged/noisy (complex median 6.61s → 6.14s), consistent with this targeting output generation rather than prefill.
Small samples, and not a quality benchmark. Fleet
output_tokens/stream_msafter rollout remains the real evaluation — and since #271 merged, those rows carryservice_tierandeffort, so the comparison can hold tier constant.Prose audit
3 added
//lines total — the single named-failure comment on the new test. No new production comments, no incident chronology in code; the measurement lives in this body and the commit message.