Skip to content

Add workflow with thinking budget#606

Open
pan-x-c wants to merge 6 commits into
agentscope-ai:mainfrom
pan-x-c:feature/reasoning_budget
Open

Add workflow with thinking budget#606
pan-x-c wants to merge 6 commits into
agentscope-ai:mainfrom
pan-x-c:feature/reasoning_budget

Conversation

@pan-x-c

@pan-x-c pan-x-c commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Description

Add a ThinkingBudgetWorkflow that:

  • Reads thinking_token_budget from workflow_args.
  • Uses raw_task["messages"] directly as OpenAI API messages.
  • Passes the budget to vLLM through extra_body.
  • Detects the forced </think> tokens returned by vLLM and masks them out in Experience.action_mask.
  • Defaults reasoning_end_str to </think>, while allowing explicit overrides.

Tests cover budget forwarding and action-mask correctness.

Checklist

Please check the following items before code is ready to be reviewed.

  • Code has passed all tests
  • Docstrings have been added/updated in Google Style
  • Documentation has been updated
  • Code is ready for review

@pan-x-c

pan-x-c commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator Author

/unittest-module-common

@yxdyc
yxdyc requested review from chenyushuo and yxdyc July 16, 2026 12:16
@github-actions

Copy link
Copy Markdown

unittest: Run #1827

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Pending ⏳ Other ❓ Flaky 🍂 Duration ⏱️
88 85 2 1 0 0 0 39m 48s

Some tests failed!

Name Failure Message
❌ tests/common/vllm_test.py::TestMessageProcess::test_truncation_status The test failed in the call phase
❌ tests/common/vllm_test.py::TestQwen35APIServerReasoning::test_thinking_token_budget_action_mask The test failed in the call phase

Github Test Reporter by CTRF 💚

@pan-x-c

pan-x-c commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator Author

/unittest-module-common

@github-actions

Copy link
Copy Markdown

unittest: Run #1828

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Pending ⏳ Other ❓ Flaky 🍂 Duration ⏱️
88 85 2 1 0 0 0 37m 19s

Some tests failed!

Name Failure Message
❌ tests/common/vllm_test.py::TestQwen35APIServerReasoning::test_thinking_token_budget_action_mask The test failed in the call phase
❌ tests/common/vllm_test.py::TestConcurrentSyncWeights::test_chat_during_weight_sync The test failed in the call phase due to an assertion error

Github Test Reporter by CTRF 💚

@pan-x-c

pan-x-c commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator Author

/unittest-module-common

@github-actions

Copy link
Copy Markdown

unittest: Run #1829

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Pending ⏳ Other ❓ Flaky 🍂 Duration ⏱️
88 87 0 1 0 0 0 39m 32s

🎉 All tests passed!

Github Test Reporter by CTRF 💚

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