8000 feat(anthropic): support output_config.effort and budget-free adaptive thinking by qqqqqf-q · Pull Request #17 · felinics/twilight · GitHub
[go: up one dir, main page]

Skip to content

feat(anthropic): support output_config.effort and budget-free adaptive thinking - #17

Merged
chen-ran merged 3 commits into
felinics:mainfrom
qqqqqf-q:feat/reason-effort-multi
Jun 3, 2026
Merged

chen-ran merged 3 commits into
felinics:mainfrom
qqqqqf-q:feat/reason-effort-multi

Conversation

@qqqqqf-q
@qqqqqf-q qqqqqf-q commented Jun 3, 2026
Copy link
Copy Markdown
Member

Summary

  • Anthropic messagesRequest 新增 output_config.effort 字段,直接透传 effort 字符串到上游,不再自行计算 token budget
  • 当 adaptive thinking 激活但未设置 budget 时,resolveMaxTokens 使用 defaultReasoningMaxTokens(32000)兜底,避免 Anthropic API 因缺少 max_tokens 报错
  • 新增两个单测覆盖 effort 透传和 budget-free adaptive 场景

Dependency

Memoh feat/reason-effort-multi 分支依赖此变更(当前通过 go.mod replace 引用本地 worktree)。

Test plan

  • TestDoGenerate_ReasoningEffort_OutputConfig — 验证 output_config.effort 正确序列化
  • TestDoGenerate_AdaptiveThinking_EffortNoBudget — 验证无 budget 时 max_tokens 默认 32000

Made with Cursor

@qqqqqf-q
qqqqqf-q marked this pull request as ready for review June 3, 2026 12:53
@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: 232adc0e3f

ℹ️ 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 provider/anthropic/messages/messages.go Resolved
qqqqqf-q and others added 3 commits June 3, 2026 23:50
…e thinking

Add output_config.effort to the messages request and consume
params.ReasoningEffort so callers can drive reasoning depth with effort
strings instead of token budgets. Adaptive thinking no longer requires
budget_tokens, and resolveMaxTokens falls back to a fixed reasoning ceiling
when reasoning is active without an explicit budget.

Co-authored-by: Cursor <cursoragent@cursor.com>
@qqqqqf-q
qqqqqf-q force-pushed the feat/reason-effort-multi branch from 232adc0 to c5b9947 Compare June 3, 2026 16:30
@chen-ran
chen-ran merged commit f4a48c3 into felinics:main Jun 3, 2026
3 checks passed
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

0