Skip to content

feat(headless): allow OPENCODE_CONFIG override for prompt ablation arms - #1855

Merged
Astro-Han merged 2 commits into
mainfrom
feat/headless-opencode-config-path
Aug 1, 2026
Merged

Astro-Han merged 2 commits into
mainfrom
feat/headless-opencode-config-path

Conversation

@Astro-Han

Copy link
Copy Markdown
Contributor

Summary

Enables the OpenCode-side prompt-ablation A/B (TB2.1: does Maka's 4-line headless system prompt explain part of the pass-rate gap vs OpenCode 1.17.18?) without forking the pinned toolchain:

  • MAKA_OPENCODE_CONFIG_PATH env override in opencode_agent.py, so one harness A/B arm can point OPENCODE_CONFIG at an alternate benchmark config. Default path and behavior are unchanged when unset.
  • New packages/headless/harbor/opencode-benchmark-makaprompt.json: byte-identical copy of opencode-benchmark.json plus agent.build.prompt set to DEFAULT_HEADLESS_SYSTEM_PROMPT. In opencode v1.17.18 (session/llm/request.ts), a config-level agent prompt fully replaces SystemPrompt.provider(model); the environment block still appends identically in both arms.

Experiment plan (local, git-excluded): maka-eval/experiments/harness-ab/terminal-bench-2.1/maka-internal-ablation-plan-20260801.md — the OpenCode-prompt leg runs opencode-original vs opencode-maka-prompt same-round paired on a death-mode-stratified task set.

Verification

  • npm run test --workspace packages/headless: pass (fail 0). New coverage: adapter smoke asserts OPENCODE_CONFIG honors the override; a contract test pins the ablation config's provider section equal to the baseline and its prompt byte-identical to DEFAULT_HEADLESS_SYSTEM_PROMPT.
  • npm run lint: clean. npm run format: applied.
  • Not run: live benchmark cells (post-merge, canary first).

Add MAKA_OPENCODE_CONFIG_PATH so a harness A/B arm can point OpenCode at
an alternate benchmark config without shadowing MAKA_REPO_ROOT, and add
opencode-benchmark-makaprompt.json whose only delta is agent.build.prompt
set byte-identically to DEFAULT_HEADLESS_SYSTEM_PROMPT (config-level
prompt fully replaces the built-in default in opencode v1.17.18).
…fig provenance

Review follow-ups for the ablation seam:

- probe the resolved OPENCODE_CONFIG with sha256sum before launch so a
  mistyped MAKA_OPENCODE_CONFIG_PATH aborts the cell instead of silently
  running OpenCode's built-in default (wrong arm)
- record opencodeConfigPath/opencodeConfigHash in the cell execution
  identity so A/B arms are distinguishable and auditable from artifacts
- pin the single-variable invariant with a full-object contract test:
  opencode-benchmark-makaprompt.json must equal the benchmark config plus
  only agent.build.prompt
@Astro-Han
Astro-Han force-pushed the feat/headless-opencode-config-path branch from 9cc1d08 to e010dad Compare August 1, 2026 18:37
@Astro-Han
Astro-Han merged commit 9002abc into main Aug 1, 2026
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