Skip to content

feat: live stack-state injection via agent harness hook (#304) - #306

Draft
aarontrowbridge wants to merge 1 commit into
mainfrom
304-feat-live-stack-state-injection-via-agent-harness-hook
Draft

feat: live stack-state injection via agent harness hook (#304)#306
aarontrowbridge wants to merge 1 commit into
mainfrom
304-feat-live-stack-state-injection-via-agent-harness-hook

Conversation

@aarontrowbridge

Copy link
Copy Markdown
Member

Implements #304.

Adds a second opencode plugin (amicode_context.ts) implementing experimental.chat.system.transform that reads solver mode, routing, active problem, and live runs on every prompt build and injects them as the final system[] entry.

Key changes:

  • opencode-plugin/stack_state.ts — standalone state readers + markdown builders (node-builtins only for Bun runtime)
  • opencode-plugin/amicode_context.ts — new plugin, single export, one hook
  • src/opencode_config.ts — solver/routing no longer appended to AGENTS.md; buildOpencodeConfigContent accepts extraPluginPaths
  • src/extension.ts — boot + solver-switch register the context plugin; solver-switch projectDir asymmetry fixed
  • ~/.amico/server/opencode-config-content.json — context plugin registered for launchd server
  • packages/extension/AGENTS.md — recovery pointer so the agent can self-heal if the hook fails

Verification: typecheck clean, all 908 tests pass (85 test files).

Adds a second opencode plugin (amicode_context.ts) implementing
experimental.chat.system.transform that reads solver mode, routing,
active problem, and live runs on every prompt build and injects them
as the final system[] entry.

- opencode-plugin/stack_state.ts — standalone state readers + builders
- opencode-plugin/amicode_context.ts — system.transform hook plugin
- src/opencode_config — removed solver/routing from file splice;
  buildOpencodeConfigContent accepts extraPluginPaths param
- src/extension.ts — registers context plugin in boot + solver-switch;
  fixes mkdtemp asymmetry in solver-switch re-prep
- AGENTS.md — one-line recovery pointer appended

Closes #304.
@aarontrowbridge aarontrowbridge linked an issue Aug 9, 2026 that may be closed by this pull request
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.

feat: live stack-state injection via agent harness hook

1 participant