GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — fix(claude): preserve generated subagent effort by jhste102lab · Pull Request #705 · lidge-jun/opencodex Conversation
|
📝 WalkthroughWalkthroughAdds validated ChangesClaude Code subagent effort
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant ClaudeCode
participant GeneratedAgent
participant OpenCodex
participant Provider
ClaudeCode->>GeneratedAgent: load model, effort, and ocx directives
GeneratedAgent->>ClaudeCode: send routed subagent request
ClaudeCode->>OpenCodex: send system ocx-route and ocx-effort directives
OpenCodex->>OpenCodex: set output_config.effort and remove thinking
OpenCodex->>Provider: forward exact reasoning_effort
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/claude-messages-endpoint.test.ts`:
- Around line 785-805: Extend the endpoint regression coverage beside the
existing max-effort test to send an ocx-effort directive of xhigh through the
same request path, then assert the captured upstream request preserves
reasoning_effort as xhigh. Keep the existing max assertion and test setup
pattern unchanged so anthropicToResponsesTranslation is verified for both
distinct effort tiers.
Fix all unresolved CodeRabbit comments on this PR:
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 9a89848d-0c0f-46a0-94aa-49d3cb5ba134
docs-site/src/content/docs/reference/configuration.mddocs-site/src/content/docs/ru/reference/configuration.mdsrc/claude/agents-inject.tssrc/claude/inbound.tssrc/config.tssrc/server/claude-messages.tssrc/types.tstests/claude-agents-inject.test.tstests/claude-inbound.test.tstests/claude-messages-endpoint.test.tstests/config.test.ts
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Here are some automated review suggestions for this pull request.
Reviewed commit: 5635eda700
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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".
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| anthropicBody.output_config = { effort: effortOverride }; | ||
| delete anthropicBody.thinking; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Preserve legacy thinking before native passthrough
When a generated ocx-self agent targets a raw model such as claude-haiku-4-5 or claude-sonnet-4-* and the request carries a native Anthropic credential, wantsNativePassthrough runs after this block. These lines unconditionally delete the valid legacy thinking: { type: "enabled", budget_tokens: ... } control and replace it with the adaptive-only effort field, even though src/adapters/anthropic.ts explicitly retains the legacy budget shape for these older families. Such native subagent turns therefore lose extended thinking or are rejected rather than preserving the configured effort; restrict this restoration to translated routed requests or compile the model-appropriate native thinking shape before passthrough.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 6d5bea1. Added focused regression coverage; 174 targeted tests and the full 5966-pass suite completed with 0 failures. Typecheck, privacy scan, and diff check also passed.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| warnDegradedClaudeSubagentEffort(parsed); | ||
| warnDegradedNativeSubagentConfig(parsed, config); | ||
| return normalizeNativeSubagentSync(config, parsed); | ||
| return normalizeClaudeSubagentEffort(normalizeNativeSubagentSync(config, parsed), parsed); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Keep invalid effort normalized across live saves
When persisted config.json contains an invalid optional value such as claudeCode.subagentEffort: "ultra", this return removes it only from the loaded object while leaving the raw file unchanged. startServer then arms the Claude subtree baseline from that normalized object, so the first unrelated saveConfigPreservingClaudeCode call treats the raw invalid subtree as a later hand edit and copies it back into the live config; a subsequent management agent sync can consequently render unsupported effort frontmatter despite the promised safe-ignore behavior. Normalize the persisted subtree used by the hand-edit comparison or persist the cleaned value before arming the baseline.
AGENTS.md reference: src/AGENTS.md:L10-L10
Useful? React with 👍 / 👎.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 6d5bea1. Added focused regression coverage; 174 targeted tests and the full 5966-pass suite completed with 0 failures. Typecheck, privacy scan, and diff check also passed.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| function warnDegradedClaudeSubagentEffort(rawParsed: unknown): void { | ||
| const rawEffort = rawClaudeSubagentEffort(rawParsed); | ||
| if (rawEffort !== undefined && !isClaudeSubagentEffort(rawEffort)) { | ||
| console.warn(`⚠️ config.json claudeCode.subagentEffort ${JSON.stringify(rawEffort)} is invalid (expected ${CLAUDE_SUBAGENT_EFFORTS.join(", ")}) — ignoring it. Other settings were preserved.`); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Do not log the invalid effort value
When a malformed persisted value is itself a credential—for example, an API key accidentally pasted into claudeCode.subagentEffort—this warning writes the complete secret to service logs via JSON.stringify(rawEffort). The value is unnecessary for diagnosing the allowed-value error and can also be an object containing credentials, so report only its type or omit it entirely rather than serializing untrusted configuration content.
AGENTS.md reference: AGENTS.md:L109-L115
Useful? React with 👍 / 👎.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 6d5bea1. Added focused regression coverage; 174 targeted tests and the full 5966-pass suite completed with 0 failures. Typecheck, privacy scan, and diff check also passed.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Extend the routed endpoint regression to verify that the shared 31,999-token Claude Code budget preserves both xhigh and max as distinct outbound effort tiers. Co-Authored-By: Claude <[email protected]>
Co-Authored-By: Claude <[email protected]>
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
tests/config.test.ts (1)
167-195: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winRestore the warning spy in a
finallyblock.If any assertion fails,
warnSpy.mockRestore()is skipped and later tests run withconsole.warnstill mocked, masking diagnostics or causing order-dependent failures.Proposed fix
const invalidEffort = "credential-like-value"; const warnSpy = spyOn(console, "warn").mockImplementation(() => {}); - writeConfig({ + try { + writeConfig({ // ... - }); + }); - const config = loadConfig(); - const diagnostics = readConfigDiagnostics(); - // assertions... - warnSpy.mockRestore(); + const config = loadConfig(); + const diagnostics = readConfigDiagnostics(); + // assertions... + } finally { + warnSpy.mockRestore(); + }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/config.test.ts` around lines 167 - 195, Wrap the assertions and diagnostic checks following the warnSpy setup in a try/finally block, and move warnSpy.mockRestore() into the finally clause. Preserve all existing expectations while ensuring console.warn is restored even when a test assertion fails.
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@tests/config.test.ts`:
- Around line 167-195: Wrap the assertions and diagnostic checks following the
warnSpy setup in a try/finally block, and move warnSpy.mockRestore() into the
finally clause. Preserve all existing expectations while ensuring console.warn
is restored even when a test assertion fails.
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 2052c03e-911b-4a3a-b81b-ffb6a76580ac
src/config.tssrc/server/claude-messages.tstests/claude-messages-endpoint.test.tstests/config-user-edits.test.tstests/config.test.ts
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
…ion hardening, Windows scheduler fixes Promotes dev to main for the v2.7.43 quick-fix release: - fix(gui): renew loopback dashboard sessions silently instead of prompting - PR #705 + follow-up: Claude effort restoration boundary hardening - PRs #694/#698/#699 and Windows scheduler compare/denial fixes
…ion hardening, Windows scheduler fixes Promotes dev to main for the v2.7.43 quick-fix release: - fix(gui): renew loopback dashboard sessions silently instead of prompting - PR lidge-jun#705 + follow-up: Claude effort restoration boundary hardening - PRs lidge-jun#694/lidge-jun#698/lidge-jun#699 and Windows scheduler compare/denial fixes
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.