Skip to content

fix(flows): pin generated Claude agent model - #121

Merged
khaliqgant merged 4 commits into
mainfrom
fix/generated-flow-model-contract-0927
Sep 27, 2026
Merged

khaliqgant merged 4 commits into
mainfrom
fix/generated-flow-model-contract-0927

Conversation

@khaliqgant

@khaliqgant khaliqgant commented Sep 27, 2026 •

Copy link
Copy Markdown
Member

Summary

Every executable agent step generated by the software-factory onboarding now carries an explicit CLI and model. The generator uses verified per-harness defaults:

  • Claude: claude-sonnet-5
  • Codex: gpt-5.6-sol
  • Cursor: gpt-5.6-sol-high
  • Grok: grok-4.7

Explicit per-step overrides still win. Changing an unavailable saved agent falls back to the selected agent and its generated default. Prototype agents now serialize model unconditionally, and default effective models no longer inflate custom_model telemetry.

This repairs failed Cloud v2 run b5d6ab22-caee-58c5-a1c7-4c02d4aa9e26: deterministic steps completed, then agent-3 was refused before execution because the generated Slack Simple source omitted model. Relayflows correctly inherited and probed Claude's adapter default, claude-opus-5, which that connected credential could not use.

Failed run: https://agentrelay.com/cloud/dashboard/workflow/b5d6ab22-caee-58c5-a1c7-4c02d4aa9e26/runner

Contract

  • Preserve Relayflows' fail-closed exact (cli, model) readiness probe and its actionable refusal.
  • Preserve explicit user overrides; the runtime still proves those exact pairs.
  • Materialize a model for every generated Simple, Traditional, and Prototype agent, including conditional discovery, repair, fixer, adversary, and prototype branches.
  • Preserve Cloud/local and GitHub/Slack generation parity.
  • Keep the enabled-agent default map exhaustive so a new enabled harness cannot silently restore omission.

Regression coverage

The invariant matrix enumerates:

  • workflows: Simple, Traditional, Prototype
  • targets: Cloud, local kit
  • sources: GitHub, Slack
  • selections: Claude; Codex; Claude + Codex; Cursor; Grok

Across all 60 variants it executes failure/repair/review paths with a capturing f.agent, asserts every observed pair matches the generator contract, and independently parses every emitted f.agent object with the TypeScript AST to require literal cli and model fields. Separate assertions cover Cloud handoff/local-kit preservation, explicit overrides, malformed persisted models, unavailable saved agents, and the third Simple agent from the failed topology.

Exact-head verification

Head: cadc1cd32a267c881c5bae1638b79d3f46e70aa4

  • related generator/preview suites: 5 files, 155 passing
  • full web suite: 32 files, 317 passing
  • router suite: 5 files, 72 passing
  • npm run build: passing (Next.js compile, TypeScript, 459 static pages)
  • git diff --check origin/main...HEAD: passing
  • Claude claude-sonnet-5: used by current Flows canonical fixtures and exact readiness round-trip exit 0
  • Codex gpt-5.6-sol: used by the current Flows real-adapter contract and exact readiness round-trip exit 0. The similarly named gpt-5.6-codex control returned HTTP 400 as unsupported for this ChatGPT-account Codex credential, so it is deliberately not used here.
  • Cursor gpt-5.6-sol-high: present in the live account catalog and exact readiness round-trip exit 0
  • Grok grok-4.7: named as the live CLI catalog default; the exact request reached the provider but returned HTTP 402 because this local credential's usage balance is exhausted. That proves the literal is recognized, not that this credential can execute it. Relayflows therefore remains responsible for the exact credential/model readiness check and will fail closed before agent work.

The accepted incident-minimal first commit is patch-identical to tested handoff 47f6315 (stable patch-id 5e28a962e6c12bb8af9f5612f574abc3c2d94cba). Review findings led to a deliberate split between blank editable overrides and explicit generated models: prompt-only edits keep telemetry and persistence clean, while executable source and previews show the current pinned model.

Rollout / rollback

Rollout is the normal reviewed PR path; this PR does not deploy. Roll back by reverting the PR commits, which restores adapter-default inheritance and would reintroduce the reported Claude refusal.

Follow-up train

Flows first-party sources and Cloud recommended-catalog/model-persistence paths contain the same omission class and require ordered follow-up PRs. This PR does not weaken or globally change the Relayflows adapter contract.

Session-Id: 01a0e2b3-ef42-7541-bdce-dcd6b88caecc

Session-Id: 01a0e2c3-b5bd-7631-b137-02be9af83c2e
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-27T15:09:04.599400Z cadc1cd Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: b4c1e4eb-a3fb-4f37-8862-afed67f0f0cb

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Devin Review

Comment thread web/lib/flow-agent-settings.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 204f7c82d1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread web/lib/flow-agent-settings.ts Outdated
@github-actions

github-actions Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Preview deployed!

Environment URL
Web https://e9efe815-agentrelay-web.agent-workforce.workers.dev

This is a Cloudflare Workers preview version of this PR's build.

Session-Id: 01a0e2c3-b5bd-7631-b137-02be9af83c2e
Session-Id: 01a0e2c3-b5bd-7631-b137-02be9af83c2e
@khaliqgant

Copy link
Copy Markdown
Member Author

@codex review

Please perform a fresh full-diff review pinned to base 9864999 and head b5ce9b0. Prior reviews targeted superseded head 204f7c8.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b5ce9b0e48

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread web/lib/flow-agent-settings.ts Outdated
Comment thread web/lib/flow-agent-settings.ts Outdated
Session-Id: 01a0e2c3-b5bd-7631-b137-02be9af83c2e
@khaliqgant

Copy link
Copy Markdown
Member Author

@codex review

Fresh full-diff review required at base 9864999 and head cadc1cd. All reviews of b5ce9b0 and earlier are superseded.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit cadc1cd. Configure here.

Comment thread web/lib/flow-agent-settings.ts
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: cadc1cd32a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@khaliqgant
khaliqgant merged commit b98fa89 into main Sep 27, 2026
5 checks passed
@khaliqgant
khaliqgant deleted the fix/generated-flow-model-contract-0927 branch September 27, 2026 15:16
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.

1 participant