Regarding thinking model: I checked openhands agen...
# proj-codescout
m
Regarding thinking model: I checked openhands agent sdk code and found it would only include reasoning content in the chat history for
kimi-k2-thinking
model (see code). @adventurous-tiger-32098 since your code assumes linear history, I don’t think it would work for thinking models because
token_ids
includes thinking tokens while
prompt_token_ids
doesn’t. If you make OpenHands agent send back reasoning content in
litellm::completions
call, they would align, but then you might hit the problem @quick-honey-73477 mentioned: qwen3 template strips previous turns’ reasoning contents. Solution: either use step-wise training in SkyRL, or use a non-thinking model.
👍 1
a
Can you remind my what was the issue with thinking models?
prompt_token_ids
does seem to include the thinking tokens from past turns. I issue I found for Qwen3 models is that when they initialized to use tool calling, they will not generate non-thinking non-tool tokens, which is why I turned on thinking for them.
m
prompt_token_ids
does seem to include the thinking tokens from past turns.
Interesting, maybe I am reading openhands code wrong? It looks like it doesn’t include thinking contents except for
kimi-k2-thinking
model. Relevant code: https://github.com/OpenHands/software-agent-sdk/blob/7046e760ddb4a70f59f779f9c308f[…]32645e9/openhands-sdk/openhands/sdk/llm/utils/model_features.py https://github.com/OpenHands/software-agent-sdk/blob/7046e760ddb4a70f59f779f9c308f0b9232645e9/openhands-sdk/openhands/sdk/llm/message.py#L295-L297
a
Here is an example of a trajectory. Agent-SDK does seem to append the model responses to the next turn
c
Solution: either use step-wise training in SkyRL, or use a non-thinking model.
irrc we discussed in today's meeting, maybe we can start with non-thinking model just for simplicity?
nod 1
a
> I issue I found for Qwen3 models is that when they initialized to use tool calling, they will not generate non-thinking non-tool tokens, which is why I turned on thinking for them. I'll have to double check but I think it would be easy to teach it to do that, either through prompting or a little sft round
m
@adventurous-tiger-32098 I think
thought
attribute is just response content, not reasoning_content: https://github.com/OpenHands/software-agent-sdk/blob/7046e760ddb4a70f59f779f9c308f[…]5e9/openhands-sdk/openhands/sdk/event/llm_convertible/action.py Your trajectory does show
reasoning_content
is null. Interestingly, I see some
<think>
blocks in the content, I wonder if there’s a templating/parsing issue on vllm/litellm side
b
For reasoning content, you can add
reasoning-parser: qwen3
to the YAML config file if you are using vLLM. When I use agent-sdk with qwen3, the reasoning content is parsed into a separate block which are not included in agent's prompts for subsequent steps
👍 1
m
Or use
--reasoning-parser
to start vLLM as documented in https://docs.vllm.ai/en/latest/features/reasoning_outputs/#quickstart
So I think @adventurous-tiger-32098’s code happened to work because reasoning parser was not enabled on vllm side --- and then the reasoning content appears in the normal message field --- and thus always included in next turn’s prompt
b
Yes, you are correct