Skip to content

Honor reasoning effort for GPT + tools on Builder, and let automations set it - #5392

Merged
enzoames merged 3 commits into
mainfrom
enzoames/changes-12057
Sep 22, 2026
Merged

enzoames merged 3 commits into
mainfrom
enzoames/changes-12057

Conversation

@enzoames

@enzoames enzoames commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • GPT reasoning models (Luna, Terra, Sol) on the hosted Builder gateway were always forced to reasoning_effort: none once tools were attached (i.e. on almost every real turn), based on a guard that assumed the gateway routed these requests to an OpenAI surface that rejects effort + tools together. That assumption didn't hold for this gateway — confirmed with a live request (200 OK, gpt-5.6-luna, 39 tools, reasoning_effort: xhigh) — so the guard is removed and the requested effort is now always forwarded, no flag needed.
  • Scheduled and event-triggered automations (Factory and other apps) can now set an explicit reasoning effort, from the automation editor UI or from either agent tool (manage-jobs, manage-automations), instead of only inheriting the model's default.

Test plan

  • Live-verified: a real request through the Builder gateway with Luna + tools + xhigh effort returned 200 OK, confirmed in both interactive chat and a Factory automation run (server logs: effort=xhigh ... ← 200 OK).
  • Automated: pnpm guards (77/77 pass), tsc --noEmit clean for packages/core and templates/factory, and targeted vitest runs for every changed spec (239 tests across builder-engine, background-automation-runner, frontmatter, automations/service, both automation tool surfaces, and the Factory action/UI specs).
  • Not independently verified: Terra and Sol specifically — the gateway team describes them as sharing the identical code path as Luna (same SDK, same routing, differing only in pricing/context-window config), but they weren't individually load-tested here.

builder-io-integration[bot]

This comment was marked as outdated.

@github-actions

github-actions Bot commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Here's a visual recap of what changed:

Visual recap

Open the full interactive recap

@github-actions
github-actions Bot temporarily deployed to pr-5392-dispatch September 19, 2026 01:12 Destroyed
@github-actions
github-actions Bot temporarily deployed to pr-5392-content September 19, 2026 01:12 Destroyed
@github-actions
github-actions Bot temporarily deployed to pr-5392-mail September 19, 2026 01:12 Destroyed
@github-actions
github-actions Bot temporarily deployed to pr-5392-starter September 19, 2026 01:12 Destroyed
@github-actions
github-actions Bot temporarily deployed to pr-5392-assets September 19, 2026 01:12 Destroyed
@github-actions
github-actions Bot temporarily deployed to pr-5392-plan September 19, 2026 01:12 Destroyed
@github-actions
github-actions Bot temporarily deployed to pr-5392-forms September 19, 2026 01:12 Destroyed
@github-actions
github-actions Bot temporarily deployed to pr-5392-analytics September 19, 2026 01:12 Destroyed
@github-actions
github-actions Bot temporarily deployed to pr-5392-design September 19, 2026 01:12 Destroyed
@github-actions
github-actions Bot temporarily deployed to pr-5392-fw September 19, 2026 01:12 Destroyed
@github-actions
github-actions Bot temporarily deployed to pr-5392-calendar September 19, 2026 01:12 Destroyed
@github-actions
github-actions Bot temporarily deployed to pr-5392-slides September 19, 2026 01:12 Destroyed
@github-actions
github-actions Bot temporarily deployed to pr-5392-clips September 19, 2026 01:12 Destroyed
…s set it

Gate the forced reasoning_effort: none for GPT reasoning models with tools
on the Builder gateway behind a new agent.builderGatewayGptResponsesLane
app-config field, so effort can flow through once the gateway proxies that
combination to the OpenAI Responses API. Add a reasoningEffort field to job
and automation frontmatter, thread it through the background automation
runner, the automations service, list-automations, both agent-facing
automation tools (manage-jobs, manage-automations), and Factory's automation
editor UI with translated labels.
Live-verified: gpt-5.6-luna + 39 tools + reasoning_effort=xhigh returns 200
OK through api.builder.io/agent-native/gateway/v1/messages. The guard forcing
"none" was based on a Chat Completions rejection actually observed on a
different engine (ai-sdk:openai via a custom proxy), not the Builder gateway,
which has always routed GPT reasoning models through the Responses API.

Delete the now-unnecessary agent.builderGatewayGptResponsesLane app-config
gate and forward the requested effort unconditionally, same as every other
model family.
@enzoames
enzoames force-pushed the enzoames/changes-12057 branch from 4bf2afc to 4ab0c40 Compare September 21, 2026 21:43
builder-io-integration[bot]

This comment was marked as outdated.

- manage-automations handleDefine silently coerced an unrecognized
  reasoning_effort to undefined and reported a successful creation, while
  update rejected the same input. Pass the raw value through and validate it
  in defineAutomation (automations/service.ts), matching updateAutomation.
- The generic manage-automation action (Agent Automations page) never
  exposed reasoningEffort at all, and its update path's required-field guard
  would reject an effort-only update outright. Add it to the schema, forward
  it on create/update, and include it in the required-field check.

Also fixes the oxfmt formatting flagged by CI lint on the design doc.
@enzoames

Copy link
Copy Markdown
Contributor Author

Both required review findings are fixed in 656d9c0:

  • handleDefine (manage-automations) no longer silently coerces an invalid reasoning_effort to undefined — it now passes the raw value through and defineAutomation validates it, matching updateAutomation's existing behavior.
  • The generic manage-automation action now exposes reasoningEffort on create/update and accepts it in the required-field check, so an effort-only update is no longer rejected.

Also fixed the CI lint failure (oxfmt formatting on the design doc).

No optional items were flagged in this pass — nothing deferred. pnpm guards (77/77), tsc --noEmit, and targeted vitest all pass with the fixes in place.

@builder-io-integration builder-io-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.

Builder reviewed your changes — looks good ✅

Review Details

Incremental Code Review Summary

The latest commits complete the two previously reported propagation fixes. The agent-facing define path now passes supplied effort values to defineAutomation, which performs the validation, and the non-agent manage-automation action now accepts nullable reasoningEffort, forwards it for create/update, supports effort-only updates, and returns the stored value. Both prior review threads were verified fixed and resolved.

The rest of the latest implementation remains coherent across Builder gateway forwarding, automation execution, frontmatter persistence, Factory save/list state, and localization. No new high-confidence bugs were found by the incremental review agents. I did not re-flag older concerns that were unchanged from the previous review cycle.

Risk assessment: Standard.

🧪 Browser testing: Attempted after this review, but all Factory UI cases were couldnt_verify; the app was reachable on a standalone Factory server, while executor sessions lacked registered Chrome/browser automation tools.

@enzoames
enzoames merged commit 113944d into main Sep 22, 2026
73 of 77 checks passed
@enzoames
enzoames deleted the enzoames/changes-12057 branch September 22, 2026 00:55
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.

2 participants