Skip to content

[plan] Phase 5: Add runtime config-renderer hook to CodingAgentEngine interface #20456

Description

@github-actions

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 RenderConfig to 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 — add RenderConfig to 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 — call RenderConfig
  • Create: pkg/workflow/engine_config_render_test.go
  • Optionally create: pkg/workflow/opencode_engine.go
  • Run: make agent-finish

Acceptance Criteria

  • RenderConfig method added to CodingAgentEngine interface
  • All four existing engines implement RenderConfig returning nil, nil
  • Orchestrator calls RenderConfig and prepends returned steps
  • Test runtime with non-nil RenderConfig output produces correct step ordering
  • All existing workflow compilation outputs unchanged (no regression in .lock.yml files — run make recompile and verify no diff)
  • make test-unit passes
    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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions