Add declarative custom-engine frontmatter and migrate Crush/OpenCode to shared behavior definitions#44465
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot remove crush/opencode from Go code and only keep them as shared agentic workflow files. |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot create a new instruction file to help with configuring new agentic engines |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot merge main and recompile |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…c-engine-syntax Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot please run the
|
|
|
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
|
@copilot please run the
|
…de.jsonc config When AWF credential isolation unsets OPENAI_API_KEY from the agent container environment, OpenCode v1.2.14 cannot initialise the 'openai' provider and falls back to the built-in 'opencode.ai' provider (model: big-pickle). That provider bypasses the AWF api-proxy entirely, so token_usage.jsonl stays empty and check_token_telemetry fails. Fix: add providers.openai.apiKey = "awf-copilot-proxy" to the opencode.jsonc config written before the agent runs. The AWF api-proxy accepts any non-empty placeholder key (credential isolation is active; it uses its own configured COPILOT_GITHUB_TOKEN for upstream auth). With the key present in the config file, OpenCode initialises the openai provider, routes LLM calls through OPENAI_BASE_URL (the api-proxy), and token telemetry is captured correctly. Also adds test assertions to verify the providers block and placeholder key appear in the generated config step. Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
…ILL.md Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Fixed in Root cause: AWF credential isolation unsets Fix: Added Also restored an accidentally-removed A maintainer re-trigger of |
…F Copilot proxy OpenCode's built-in `opencode` provider routes all LLM calls to opencode.ai directly, bypassing the AWF api-proxy entirely. This means token_usage.jsonl is never written and the check_token_telemetry job fails. Fix: write the following fields into opencode.jsonc during the config step: - `disabled_providers: ["opencode"]` — prevents the opencode.ai smart router from intercepting model requests - `provider.openai.options.baseURL: http://host.docker.internal:10002` — explicitly configures the openai provider to send requests through the AWF Copilot LLM gateway (same URL already set in OPENAI_BASE_URL env var) - `provider.openai.models.gpt-5: {}` — registers gpt-5 under the openai provider so OPENCODE_MODEL=openai/gpt-5 resolves without hitting models.dev With the opencode provider disabled, OPENCODE_MODEL=openai/gpt-5 routes to OpenCode's built-in openai provider (backed by @ai-sdk/openai). Since that provider is activated via config (not built-in autoload), OpenCode uses sdk.languageModel() (Chat Completions format) rather than sdk.responses() (Responses API), which the AWF Copilot proxy at port 10002 handles correctly. All LLM calls go through the proxy → OPENAI_API_KEY (GitHub Copilot token) used for auth → token_usage.jsonl written → check_token_telemetry passes. Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Fixed in commit Root cause: OpenCode's built-in Fix (
With the Local validation: |
…c-engine-syntax Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Hand-off: CI must be re-triggered by a maintainer ( |
|
/smoke-opencode |
|
|
|
@copilot please run the
|
…rovider block Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
…rovider.openai block Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Fixed in the latest commit. Root cause (run §29121662603): OpenCode v1.2.14's config schema rejects The Fix: Removed the invalid A maintainer |
|
@copilot please run the
|
…c-engine-syntax Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Hand-off: CI must be re-triggered by a maintainer ( |
|
@copilot please run the
|
Actions taken: none — all fixes were already committed in prior iterations. No uncommitted changes. Hand-off: CI must be re-triggered by a maintainer ( |
|
@copilot please run the Unresolved review feedback to address:
|
Actions taken: none — all threads are already resolved and local validation is green. Hand-off: CI must be re-triggered by a maintainer ( |
This introduces a richer engine-definition frontmatter shape for shared/custom agentic engines and uses it to move Crush and OpenCode off bespoke Go implementations onto a common declarative runtime path. The new syntax is expressive enough for CLI-style engines that need install, config, execution, MCP, capability, and auth wiring, including Auggie-like cases.
New engine-definition surface
engine.experimental,engine.auth, andengine.behaviorsto the named engine definition form.behaviorscaptures the runtime contract instead of hard-coding it in Go:authprovides explicit secret bindings for engines that need engine-specific credentials forwarded into the runtime.Shared behavior-defined runtime
BehaviorDefinedEnginethat materializes aCodingAgentEnginefrom frontmatter.Crush/OpenCode refactor
pkg/workflow/data/engines/crush.mdpkg/workflow/data/engines/opencode.mdSchema and docs
Coverage
Example of the new shared engine definition shape: