Skip to content

fix(ultrawork-model-override): fix thinking config when upgrading variant#2106

Merged
code-yeongyu merged 4 commits intodevfrom
fix/issue-2049-ultrawork-thinking-config
Feb 25, 2026
Merged

fix(ultrawork-model-override): fix thinking config when upgrading variant#2106
code-yeongyu merged 4 commits intodevfrom
fix/issue-2049-ultrawork-thinking-config

Conversation

@code-yeongyu
Copy link
Owner

@code-yeongyu code-yeongyu commented Feb 25, 2026

Summary

  • Fix ultrawork variant overrides to inject a structured thinking config object instead of copying the variant string into message.thinking.
  • Keep the change targeted to ultrawork-model-override and apply the same object assignment in both variant-only and direct-mutation fallback paths.
  • Update regression assertions so ultrawork now preserves thinking in enabled mode with a token budget.

Testing

  • bun test src/plugin/ 2>&1
  • bun run typecheck 2>&1

Fixes #2049


Summary by cubic

Set ultrawork message.thinking to a structured config { type: "enabled", budgetTokens: 16000 } when a variant is applied, and fix Hephaestus provider gating by correcting tests (Copilot-only should not create Hephaestus). Fixes #2049 and stabilizes a flaky CI test.

  • Bug Fixes
    • Apply the thinking config in both variant-only and model-targeted override paths; update tests to assert the object shape.
    • Revert the requiresProvider change and fix the test to expect Hephaestus is absent when only github-copilot is connected; add a readConnectedProvidersCache mock to prevent state leaks.

Written for commit e00f461. Summary will update on new commits.

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 2 files

Confidence score: 2/5

  • There is a concrete risk of incorrect behavior: src/plugin/ultrawork-model-override.ts is missing structured thinking config on the main deferred DB path, so the DB can still be overwritten with a raw string variant.
  • Given the high severity and clear impact on persisted configuration, this feels risky to merge without addressing the missing assignment/deduplication.
  • Pay close attention to src/plugin/ultrawork-model-override.ts - ensure the variant/config is set in the main deferred DB path without duplicate assignments.
Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/plugin/ultrawork-model-override.ts">

<violation number="1" location="src/plugin/ultrawork-model-override.ts:121">
P1: The structured thinking config is missing from the main deferred DB path, causing the DB to still be overwritten with a raw string variant. 

To fix this and eliminate the duplicated assignments:
1. Move the `variant` and `thinking` assignments to the top of the function (right after checking `if (!override)`).
2. Remove the assignments from the early return blocks.
3. Omit the `override.variant` argument from the `scheduleDeferredModelOverride` call so the DB layer doesn't overwrite the correct memory object.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

if (override.variant) {
output.message["variant"] = override.variant
output.message["thinking"] = override.variant
output.message["thinking"] = { ...ULTRAWORK_THINKING_CONFIG }
Copy link

@cubic-dev-ai cubic-dev-ai bot Feb 25, 2026

Choose a reason for hiding this comment

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

P1: The structured thinking config is missing from the main deferred DB path, causing the DB to still be overwritten with a raw string variant.

To fix this and eliminate the duplicated assignments:

  1. Move the variant and thinking assignments to the top of the function (right after checking if (!override)).
  2. Remove the assignments from the early return blocks.
  3. Omit the override.variant argument from the scheduleDeferredModelOverride call so the DB layer doesn't overwrite the correct memory object.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/plugin/ultrawork-model-override.ts, line 121:

<comment>The structured thinking config is missing from the main deferred DB path, causing the DB to still be overwritten with a raw string variant. 

To fix this and eliminate the duplicated assignments:
1. Move the `variant` and `thinking` assignments to the top of the function (right after checking `if (!override)`).
2. Remove the assignments from the early return blocks.
3. Omit the `override.variant` argument from the `scheduleDeferredModelOverride` call so the DB layer doesn't overwrite the correct memory object.</comment>

<file context>
@@ -117,7 +118,7 @@ export function applyUltraworkModelOverrideOnMessage(
     if (override.variant) {
       output.message["variant"] = override.variant
-      output.message["thinking"] = override.variant
+      output.message["thinking"] = { ...ULTRAWORK_THINKING_CONFIG }
     }
     return
</file context>
Fix with Cubic

…vider

Hephaestus requires GPT models, which can be provided by github-copilot.
The requiresProvider list was missing github-copilot, causing hephaestus
to not be created when github-copilot was the only GPT provider connected.

This also fixes a flaky CI test that documented this expected behavior.
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 1 file (changes from recent commits).

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/shared/model-requirements.ts">

<violation number="1" location="src/shared/model-requirements.ts:27">
P1: GitHub Copilot does not support `gpt-5.3-codex`. Adding it here violates codebase constraints and will break existing tests.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

…st expectation

The test 'hephaestus is created when github-copilot provider is connected'
had incorrect expectation. github-copilot does not provide gpt-5.3-codex,
so hephaestus should NOT be created when only github-copilot is connected.

This test was causing CI flakiness due to incorrect assertion and
missing readConnectedProvidersCache mock (state pollution between tests).

Also adds cacheSpy mock for proper isolation.
@code-yeongyu code-yeongyu merged commit cf0d157 into dev Feb 25, 2026
8 checks passed
@code-yeongyu code-yeongyu deleted the fix/issue-2049-ultrawork-thinking-config branch February 25, 2026 07: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.

[Bug]: entering Ultra Work disables thinking for Claude Opus 4.6

1 participant