Repository navigation
fix(observability): tool span arguments sentinel + missing reasoning parts - #218
Merged
luk384090-cloud merged 4 commits intoOct 27, 2026
Conversation
added 3 commits
October 25, 2026 18:48
typing.Dict cannot be instantiated; the TypeError was swallowed by the broad except in _bind_tool_arguments, so every @observe_tool span recorded {"_error": "could_not_bind_arguments"} instead of the real arguments.
The OpenAI and DashScope output-message converters ignored reasoning_content, so chat spans never echoed model thinking although the schema (Reasoning part) supports it. Export Reasoning from the _core facade and insert the part first.
W0611 unused-import: Reasoning is re-exported for the converters in messages.py, not referenced inside _core.
XudongZhang-1224
force-pushed
the
fix/observability-tool-args-and-llm-reasoning
branch
from
October 26, 2026 11:41
15293e3 to
5248631
Compare
Import Reasoning in a nested try so environments with loongsuite-util-genai < 0.4.0 degrade to missing reasoning parts instead of GENAI_AVAILABLE=False.
XudongZhang-1224
force-pushed
the
fix/observability-tool-args-and-llm-reasoning
branch
from
October 26, 2026 11:45
5248631 to
be55a1b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fix two silent-degradation bugs in the GenAI observability mapping layer
(
dashscope/finetune/reinforcement/component/observability/genai/), bothobserved in production RFT agentic-rollout traces and still present on
main @ v2.0.1:
_bind_tool_argumentscallstyping.Dict(bound.arguments);typing.Dictcannot be instantiated, so every
@observe_toolcall raises TypeError,which the broad
except Exceptionswallows and replaces with{"_error": "could_not_bind_arguments"}as the span's tool-call arguments.sig.bind_partialitself succeeds; only the dict conversion crashes.Fix: use builtin
dict().openai_completion_to_output_messagesanddashscope_response_to_output_messagesonly mapcontentandtool_calls;reasoning_contentis never read, although the schema(
opentelemetry.util.genai.types.Reasoning, semconv ReasoningPart)supports it and the trace UI renders it. Fix: export
Reasoningfrom the_corefacade and insert a Reasoning part first in each output message.Related Issue: N/A — no upstream issue; reported from production traces
(dashscope 1.26.7, and live-confirmed on 1.27.6 in a running FC function).
Security Considerations: This change adds no logging of secrets and
exposes no credentials. (An unrelated pre-existing issue is noted under
Additional Notes.)
Type of Change
Component(s) Affected
Checklist
Testing
_bind_tool_argumentsreturns the realkwargs (no sentinel); the OpenAI converter emits parts
[reasoning, tool_call]for a completion carryingreasoning_content;the DashScope converter emits
[reasoning]; a message without reasoningstays
[text](no regression).decorated tool path records
gen_ai.tool.call.argumentsas the realcommand JSON (no sentinel) plus
gen_ai.tool.call.result; the decoratedLLM path (demo-style result_mapper) records
gen_ai.output.messagescontaining reasoning and tool_call parts.
(FC startup log:
Successfully installed dashscope-2.0.1) shows realshell commands in bash tool span inputs and reasoning parts in chat span
outputs in the trace UI.
CI expected to run as usual.
Additional Notes
loongsuite-util-genaiis absent,_core.Reasoningis None and the new helper no-ops, preserving the module's
silent-degradation contract; messages without
reasoning_contentarebyte-identical to before.
the AgenticRL submit-path log prints the full job request payload at INFO,
including component env vars that carry API keys. Suggest masking env
values in that log in a follow-up.