Skip to content

fix(agents): preserve LLMAgent recorder metadata - #296

Open
Gujiassh wants to merge 1 commit into
TencentCloudADP:mainfrom
Gujiassh:fix/llm-recorder-metadata
Open

Gujiassh wants to merge 1 commit into
TencentCloudADP:mainfrom
Gujiassh:fix/llm-recorder-metadata

Conversation

@Gujiassh

@Gujiassh Gujiassh commented Oct 2, 2026 •

Copy link
Copy Markdown

Summary

Closes #295.

LLMAgent.run passed input and trace_id positionally to TaskRecorder. Inherited dataclass fields consumed these values as completion/error state, leaving the returned task, input and trace metadata empty even when the model run succeeded.

  • Initialize the existing task/input/trace_id fields by keyword.
  • Preserve string tasks and original response-item lists; list inputs retain the existing empty task default without guessing a task string.
  • Add actual Runner regressions for string/list input and supplied/generated trace IDs, including output, trajectory and pure trajectory-model conversion.

No API, schema, persistence or streaming changes.

Validation

Python3.12, real LLMAgent/Runner with a local SDK Model; no remote provider or database writes:

  • Four new regressions fail on main and pass after the fix; 10 bounded agent/common/parser tests pass.
  • Standalone real-run reproduction now returns the correct metadata and legal inherited state while preserving the answer/trajectory.
  • Changed-file Ruff and format checks pass.
  • Focused mypy has 4 pre-existing implicit-Optional errors; exact-main comparison has those same 4 plus 2 incorrect-constructor diagnostics. No new test/changed-line errors.

Full suite, live providers, database persistence and streaming were not validated.

This branch has not been deployed

No deployments
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.

LLMAgent.run loses recorder input and trace metadata

1 participant