Skip to content

fix(workflow): support integration: auto to follow project's initialized AI#2421

Open
Quratulain-bilal wants to merge 1 commit intogithub:mainfrom
Quratulain-bilal:fix/workflow-integration-auto-default
Open

fix(workflow): support integration: auto to follow project's initialized AI#2421
Quratulain-bilal wants to merge 1 commit intogithub:mainfrom
Quratulain-bilal:fix/workflow-integration-auto-default

Conversation

@Quratulain-bilal
Copy link
Copy Markdown
Contributor

@Quratulain-bilal Quratulain-bilal commented Apr 30, 2026

Closes #2406

Problem

The speckit workflow's integration input had default: "copilot" hardcoded in workflows/speckit/workflow.yml. This meant projects initialized with claude or gemini would silently fall back to copilot when running the workflow without an explicit --input integration=... flag, breaking the principle of least surprise.

Fix

  • workflows/speckit/workflow.yml: change default: "copilot"default: "auto", update the prompt to describe the new behavior.
  • src/specify_cli/workflows/engine.py: add _resolve_default() so that when an input default is the sentinel string "auto" and the input name is "integration", the engine reads .specify/integration.json and uses the project's initialized integration. Falls back to the literal "auto" when the file is missing or malformed (engine treats unresolved values harmlessly).
  • tests/test_workflows.py: 4 new regression tests covering the resolution path, the missing-file fallback, the explicit-input override, and the malformed-JSON path.

The change is opt-in via the YAML default, so existing workflows that hardcode default: "copilot" (or any other literal) keep working unchanged. Only workflows that opt into default: "auto" get the new resolution.

Test plan

  • All 130 workflow tests pass locally
  • speckit workflow respects .specify/integration.json when no --input is given
  • Explicit --input integration=copilot still overrides the project default
  • Missing or malformed .specify/integration.json does not crash the engine

…zed AI

The bundled `speckit` workflow YAML hardcoded `integration: copilot` as the
default for the `integration` input. When a project was initialized for a
different AI (e.g. opencode) and the `copilot` CLI happened to be installed
on the same system, `specify workflow run speckit` would silently dispatch
to copilot — which then failed with "No such agent: speckit.specify"
because the agent files live under `.opencode/command/`, not
`.github/agents/`. See github#2406 for a full failure trace.

The fix is two small pieces:

1. Workflow engine: `_resolve_inputs` now recognizes the sentinel
   `default: "auto"` for the `integration` input and resolves it against
   `.specify/integration.json`. When the file is absent or malformed the
   literal `"auto"` is preserved so the dispatcher can surface a clear
   error instead of silently picking a wrong AI.

2. Bundled workflow: `workflows/speckit/workflow.yml` switches its
   `integration` default from the hardcoded `"copilot"` to `"auto"`.

Explicit `--input integration=<name>` continues to win — `auto` only
applies when no value is provided.

Tests cover the four meaningful paths: integration.json present, file
missing, malformed JSON, and explicit override.

Refs github#2406
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.

[Bug]: Workflow engine hardcodes "copilot" default, ignoring project's initialized integration (e.g., opencode)

1 participant