fix: default unknown models to the full prompt, single-source product identity and version - #286
Conversation
Adding .gitkeep for PR creation (default mode). This file will be removed when the task is complete. Issue: #285
…g and version - Resolve the system prompt from a table with an explicit, logged default (anthropic, which includes todo/task-tracking) instead of silently falling back to the without-todo qwen prompt for every unrecognised model id. AGENT_SYSTEM_PROMPT provides an explicit opt-out. - Add src/branding.ts as the single source of the product identity and apply it at render time to system prompts and tool descriptions, so the agent no longer identifies as opencode or routes bug reports to sst/opencode. - Add src/version.ts reading the package manifest; use it for --version, the process log and session records (was hard-coded 'agent-cli-1.0.0'). - Add regression tests for all three. Fixes #285
opencode; session records report a hard-coded version…actor The refactor accidentally removed the anthropic OAuth spoof header helper, breaking every session (TypeError: SystemPrompt.header is not a function). Restore it and add a test covering the exported api surface.
Working session summaryDone. PR: #286 (ready for review, all CI green — run 30571970748). What changed — all three defects from issue #285:
Tests ( One thing worth flagging: my first push broke every session — the refactor edit accidentally dropped This summary was automatically extracted from the AI working session output. |
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost: $3.586678📊 Context and tokens usage:
Total: (148 new + 68.0K cache writes + 4.6M cache reads) input tokens, 24.0K output tokens, $3.586678 cost 🤖 Models used:
📎 Log file uploaded as Gist (1832KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
🎉 Auto-mergedThis pull request has been automatically merged by hive-mind.
Auto-merged by hive-mind with --auto-merge flag |
Summary
Fixes #285 — three defects that made a session's behaviour unattributable, all fixed with the generalizations requested in the issue rather than another
if.1 — Unknown models no longer fall back to the without-todo prompt
js/src/session/system.tsnow resolves the prompt through a rule table with an explicit default:anthropic.txt(12 mentions of todo) instead ofqwen.txt(0);system prompt: anthropic (default for unknown model formalai/formal-ai)(servicesystem-prompt), so a run's prompt is attributable from its log;AGENT_SYSTEM_PROMPT=anthropic-without-todo(also usable to pin any other prompt:anthropic,beast,codex,gemini,grok-code,polaris). An unknown value is ignored with a warning. This also removes the "no workaround from the caller side" gap.2 — The agent no longer says it is
opencodeNew
js/src/branding.tsholds the product identity (name, repo, issues URL, docs URL) in one place and substitutes it at render time, so the prompt files stay byte-identical to their upstream originals and a rename is one edit instead of eight. Applied to every provider prompt, the summarize/title prompts, and thebashtool description (which also mentioned opencode).Bug reports the model is told to file now go to
https://github.com/link-assistant/agent/issues.3 — Session records report the real version
New
js/src/version.tsreads the package manifest and is the single source for--version, the process log andSession.createNext(js/src/session/index.tspreviously hard-codedagent-cli-1.0.0).How to reproduce the original behaviour
agent --model formalai/formal-ai --print-logs --verbose "say hi"Before: the system message begins
You are opencode, an interactive CLI tool…, contains no todo instructions, points users atsst/opencode/issues, and the stored session record says"version": "agent-cli-1.0.0".After: the system message is the full anthropic prompt with todo discipline, all product references point at this repo, and the session record carries the real version (
0.25.3).Tests
js/tests/system-prompt.ts(new):AGENT_SYSTEM_PROMPTopt-out works and invalid values are ignored;/opencode/i,sst/opencodeoropencode.ai— branding cannot regress when a prompt is re-synced from upstream;SystemPrompt.headerstill returns the anthropic OAuth spoof (api-surface guard).js/tests/version.ts(new):VERSION === package.json version, is semver-shaped, and session records use the shared constant.npm run check(eslint + prettier + file size) passes.