Skip to content

fix: marking executed tool calls on webhooks#2479

Merged
dartpain merged 1 commit into
mainfrom
fix-badly-marked-tool-calls
May 17, 2026
Merged

fix: marking executed tool calls on webhooks#2479
dartpain merged 1 commit into
mainfrom
fix-badly-marked-tool-calls

Conversation

@dartpain
Copy link
Copy Markdown
Contributor

  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

  • Why was this change needed? (You can also link to an open issue here)

  • Other information:

@vercel
Copy link
Copy Markdown

vercel Bot commented May 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nextra-docsgpt Building Building Preview, Comment May 17, 2026 8:52pm
oss-docsgpt Ready Ready Preview, Comment May 17, 2026 8:52pm

Request Review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a bug where tool calls executed in webhook contexts (where save_conversation=False and no message is reserved) would be left in the executed state forever — since the message-finalize path that flips executed → confirmed never runs without a message. The repository now writes such rows directly as confirmed, allowing the reconciler/journal to reflect the true terminal state.

Changes:

  • mark_executed and upsert_executed now write status='confirmed' instead of 'executed' when no message_id is supplied.
  • Updated existing tests and docstrings to reflect the new semantics, and added new tests for the with-message and without-message paths (including the upsert_executed fallback).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
application/storage/db/repositories/tool_call_attempts.py Parameterizes status in both mark_executed and upsert_executed, choosing confirmed when message_id is None.
tests/agents/test_tool_executor_three_phase.py Renames and rewrites tests to cover the new no-message → confirmed behavior; deduplicates tools_dict into a module-level fixture; adds repository-level tests for the with/without message_id branches.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.37%. Comparing base (9b8fe2d) to head (c0510b9).
⚠️ Report is 32 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2479      +/-   ##
==========================================
+ Coverage   91.34%   91.37%   +0.03%     
==========================================
  Files         248      265      +17     
  Lines       20709    22653    +1944     
==========================================
+ Hits        18916    20699    +1783     
- Misses       1793     1954     +161     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dartpain dartpain merged commit c066465 into main May 17, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

application Application tests Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants