Forge: link session query completion events - #20
Merged
Conversation
Match exact session_store_sql start arguments and associate results by tool-call ID when large completion details omit the SQL text. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: b8cf0691-0fe3-4d67-92ce-ce2a529c400c
There was a problem hiding this comment.
Pull request overview
This PR improves how materialize-session-query.py associates a session_store_sql tool completion with its originating query by linking tool.execution_start and tool.execution_complete via the shared toolCallId, allowing results to be materialized even when completion events omit SQL text in detailedContent.
Changes:
- Track matching
toolCallIdvalues fromtool.execution_startevents whosearguments.queryexactly equals the requested SQL. - Prefer matching
tool.execution_completeevents bytoolCallId, while keeping the existingdetailedContentSQL matching as a fallback. - Add a regression test covering completions where SQL is omitted from the detailed output.
Show a summary per file
| File | Description |
|---|---|
| plugins/repo-dreamer/skills/repository-skill-forge/scripts/materialize-session-query.py | Links query start → completion via toolCallId and retains the existing detailed-content matcher as fallback. |
| plugins/repo-dreamer/skills/repository-skill-forge/tests/test_materialize_session_query.py | Adds regression coverage ensuring call-id matching works when completion detailedContent lacks SQL. |
Review details
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
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.
Summary
tool.execution_starteventtoolCallIdontool.execution_completeRoot cause
Task
f810e547-693b-4fd3-9ce2-f63e3d832cd0materialized discovery, metadata, references, and files successfully. Its large tool query completed, but the completion detail did not contain matchable SQL, so the bridge reported that the result was absent. Runtime start events preserve the full exact SQL and a stable call ID.Validation
git diff --checkpasses