Skip to content

refactor(models): Refine MessageAgentThought SQLAlchemy typing#11

Open
tomerqodo wants to merge 2 commits intoaugment_full_base_refactormodels_refine_messageagentthought_sqlalchemy_typing_pr11from
augment_full_head_refactormodels_refine_messageagentthought_sqlalchemy_typing_pr11
Open

refactor(models): Refine MessageAgentThought SQLAlchemy typing#11
tomerqodo wants to merge 2 commits intoaugment_full_base_refactormodels_refine_messageagentthought_sqlalchemy_typing_pr11from
augment_full_head_refactormodels_refine_messageagentthought_sqlalchemy_typing_pr11

Conversation

@tomerqodo
Copy link
Copy Markdown

Benchmark PR from agentic-review-benchmarks#11

@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented Jan 26, 2026

🤖 Augment PR Summary

Summary: Refactors the MessageAgentThought model to use richer SQLAlchemy typing and more explicit defaults.

Changes:

  • Updates MessageAgentThought to inherit from TypeBase and adds/aligns typed Mapped[...] columns (including Decimal pricing fields).
  • Adjusts agent thought creation to use Decimal values and CreatorUserRole for created_by_role.
  • Makes thought appending in save_agent_thought robust to NULL existing values.
  • Refines tool input/observation parsing in agent history reconstruction to better handle missing/malformed JSON.
  • Updates integration tests to stop passing explicit id values for MessageAgentThought.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

tool_call_response.append(
ToolPromptMessage(
content=tool_responses.get(tool, agent_thought.observation),
content=str(tool_inputs.get(tool, agent_thought.observation)),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tool_responses is parsed above but this ToolPromptMessage uses tool_inputs, which looks like it will surface the tool inputs as the tool output in history. This also makes tool_responses unused, so consider switching this to tool_responses.get(...) (stringified) to preserve the actual observation/result.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

answer_token=0,
answer_unit_price=0,
answer_price_unit=0,
answer_unit_price=Decimal("0.001"),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In create_agent_thought, answer_unit_price=Decimal("0.001") with answer_price_unit=Decimal(0) seems inverted compared to the message fields and the DB defaults (price unit defaulting to 0.001). If this record is read before llm_usage is applied, these initial values could misrepresent pricing.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

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.

1 participant