Conversation
…mary The footer displayed model.provider from config instead of the provider that actually answered the turn. After a fallback switch this was wrong — e.g. showing 'Provider: kimi' while the agent ran 'volces-agent'. Root cause: agent/turn_finalizer.py invoked the transform_llm_output hook without passing provider, so the runtime-footer plugin fell back to config's model.provider. gateway/run.py likewise didn't propagate the runtime provider into the agent_result dicts consumed by the built-in footer path. Changes (scoped to the provider-propagation bug only — OpenClaw footer formatting/field work stays in NousResearch#66372): - agent/turn_finalizer.py: pass provider + agent id into the transform_llm_output hook call. - gateway/run.py: include 'provider' in both agent_result dicts and pass it to build_footer_line. - gateway/runtime_footer.py: add a provider param to format_runtime_footer and build_footer_line; falls back to config.model.provider only when the runtime value is missing (legacy call sites stay populated). - tests/gateway/test_runtime_footer.py: +4 cases — runtime provider wins over config, config fallback, omitted-when-both-missing. 29 passed.
bf83ed9 to
b31091a
Compare
|
Thanks for the triage. Good call on the scope — I've narrowed this PR to only the runtime-provider propagation fix (the distinct fallback-display bug), and dropped the broader OpenClaw footer formatting / field-behavior changes so they stay in #66372. What remains in this PR (b31091a, +93/-0):
What moved out (openclaw This PR is now orthogonal to both #66372 and #62277. |
teknium1
left a comment
There was a problem hiding this comment.
Thanks for splitting the provider-propagation work out of the broader footer changes. The core premise is real: fallback activation updates agent.provider in agent/chat_completion_helpers.py:1877-1879, while current main drops that value before the footer at gateway/run.py:23175, gateway/run.py:23302, and gateway/run.py:14710-14717.
Problems
provideris newly accepted as a footer field, butwebsite/docs/user-guide/configuration.md:1658-1665still documents onlymodel,context_pct, andcwd.- The added tests call
build_footer_line()directly. They do not cover either changed result-dict path or the final gateway call site that propagates the value. agent/turn_finalizer.pyalso adds an undocumentedagentargument to the publictransform_llm_outputhook. The documented callback contract atwebsite/docs/user-guide/features/hooks.md:1257-1275does not include it, and it is outside the stated provider-only scope.
Suggested changes
- Document the new field and add a gateway-level fallback regression test.
- Remove the
agenthook kwarg unless its contract is documented and independently covered.
Automated hermes-sweeper review.
| model=agent.model, | ||
| platform=getattr(agent, "platform", None) or "", | ||
| provider=getattr(agent, "provider", None), | ||
| agent=getattr(agent, "agent_id", None) or getattr(agent, "id", None), |
There was a problem hiding this comment.
transform_llm_output is a public plugin hook, but its documented callback contract currently has no agent kwarg (website/docs/user-guide/features/hooks.md:1257-1275). Please remove this scope expansion or document and test the new hook payload separately.
| m = _model_short(model) | ||
| if m: | ||
| parts.append(m) | ||
| elif field == "provider": |
There was a problem hiding this comment.
Please update the runtime-footer configuration reference: it currently declares only model, context_pct, and cwd as supported fields (website/docs/user-guide/configuration.md:1658-1665).
Independent provider-only implementation and verificationI reproduced and implemented the provider-propagation slice independently against the current upstream Current
Validation on current upstream Real-world Telegram output with the field enabled (default profile, fallback chain active in the second example): This is intentionally narrower than the token/cost/quota expansion in #35427 / #18188. Since this PR already targets the same runtime-provider propagation problem (including the |
Problem
The footer displayed
model.providerfrom config instead of the provider that actually answered the turn. After a fallback switch this was wrong — e.g. showingProvider: kimiwhile the agent ranvolces-agent.Root cause
agent/turn_finalizer.pyinvoked thetransform_llm_outputhook without passingprovider, so the runtime-footer plugin fell back toconfig.model.provider.gateway/run.pylikewise did not propagate the runtime provider into theagent_resultdicts consumed by the built-in footer path.Changes (scoped to provider propagation only)
Per triage feedback, this PR is now scoped strictly to the provider-propagation bug. The broader OpenClaw footer formatting / field-behavior work stays in #66372.
agent/turn_finalizer.py— passprovider=getattr(agent, "provider", None)and the agent id into thetransform_llm_outputhook call. (root fix)gateway/run.py— include"provider": getattr(_agent, "provider", None)in bothagent_resultdicts; passprovidertobuild_footer_line.gateway/runtime_footer.py— add aproviderparam toformat_runtime_footerandbuild_footer_line; falls back toconfig.model.provideronly when the runtime value is missing (legacy call sites stay populated).tests/gateway/test_runtime_footer.py— +4 cases: runtime provider wins over config, config fallback, omitted-when-both-missing.Verification
venv/bin/python -m pytest tests/gateway/test_runtime_footer.py -q→ 29 passedprovider="volces-agent"propagated, the footer now showsvolces-agentinstead ofkimi(the configured primary).Relationship to #66372 / #62277
This PR is now orthogonal to both: it only fixes the provider-display root cause (the
transform_llm_outputhook not receiving the runtime provider). OpenClaw footer formatting and field-behavior enhancements remain in #66372. #62277 (CLI status-bar provider display) is a separate surface.