-
Notifications
You must be signed in to change notification settings - Fork 295
Description
Objective
Add a config-renderer hook to the runtime adapter interface so runtimes can emit generated config files and metadata. This allows engines like OpenCode (which use provider/model config files rather than just flags and env vars) to participate in the architecture cleanly.
Context
Issue #20416 Phase 5: some runtimes need to write config files to disk before execution (e.g., OpenCode's ~/.opencode/config.toml). Currently, all runtime configuration happens through env vars and command flags. This hook decouples config generation from execution step generation.
Prerequisite: Phases 1–4 should be merged first, though this phase is less tightly coupled than the others.
Approach
1. Add RenderConfig to the CodingAgentEngine interface in pkg/workflow/agentic_engine.go
// RenderConfig optionally generates runtime config files or metadata.
// Returns a slice of GitHub Actions steps that write config to disk.
// Implementations that don't need config files should return nil, nil.
RenderConfig(target *ResolvedEngineTarget) ([]map[string]any, error)2. Implement no-op RenderConfig in all existing runtime adapters
In pkg/workflow/claude_engine.go, codex_engine.go, copilot_engine.go, gemini_engine.go:
func (e *ClaudeEngine) RenderConfig(target *ResolvedEngineTarget) ([]map[string]any, error) {
return nil, nil
}This preserves backward compatibility — no behavior change for existing engines.
3. Call RenderConfig from the orchestrator
In pkg/workflow/compiler_orchestrator_engine.go, after resolving the engine target, call runtime.RenderConfig(target) and prepend any returned steps before the execution steps.
4. Add a test runtime that uses RenderConfig
In test code only, create a minimal configRenderingEngine that writes a dummy config file step. Test that the orchestrator includes those steps in the correct position (before execution steps).
5. (Optional) Add a skeleton OpenCode engine
If time permits, add a skeleton pkg/workflow/opencode_engine.go that:
- Registers in the catalog as
opencode - Implements
RenderConfigto emit a step that writes an OpenCode config file - Does not need to be feature-complete — just validates the hook works end-to-end
This is optional and can be a separate follow-up issue if it grows too large.
Files to Modify
- Modify:
pkg/workflow/agentic_engine.go— addRenderConfigto interface - Modify:
pkg/workflow/claude_engine.go,codex_engine.go,copilot_engine.go,gemini_engine.go— add no-op implementations - Modify:
pkg/workflow/compiler_orchestrator_engine.go— callRenderConfig - Create:
pkg/workflow/engine_config_render_test.go - Optionally create:
pkg/workflow/opencode_engine.go - Run:
make agent-finish
Acceptance Criteria
-
RenderConfigmethod added toCodingAgentEngineinterface - All four existing engines implement
RenderConfigreturningnil, nil - Orchestrator calls
RenderConfigand prepends returned steps - Test runtime with non-nil
RenderConfigoutput produces correct step ordering - All existing workflow compilation outputs unchanged (no regression in
.lock.ymlfiles — runmake recompileand verify no diff) -
make test-unitpasses
Related to GitHub Agentic Workflow Engine Enhancement Proposal #20416
Generated by Plan Command for issue #20416 · ◷
- expires on Mar 13, 2026, 2:45 AM UTC