-
Notifications
You must be signed in to change notification settings - Fork 38
fix(activity): detect git commits via tool_result event instead of command.executed #58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,6 +37,7 @@ import { | |
| isTraceEnabled, | ||
| resolveSessionTraceContext, | ||
| } from "../util.ts" | ||
| import { handleToolResult } from "./activity.ts" | ||
| import type { HandlerContext } from "../types.ts" | ||
|
|
||
| const OPENINFERENCE_SPAN_KIND = SemanticConventions.OPENINFERENCE_SPAN_KIND | ||
|
|
@@ -373,6 +374,10 @@ export function handleMessagePartUpdated(e: EventMessagePartUpdated, ctx: Handle | |
| ? { tool_result_size_bytes: Buffer.byteLength((toolPart.state as { output: string }).output, "utf8") } | ||
| : { error: (toolPart.state as { error: string }).error } | ||
|
|
||
| if (success) { | ||
|
Comment on lines
374
to
+377
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add an integration-style handler test that sends a completed bash |
||
| handleToolResult(toolPart.tool, toolPart.state.input, toolPart.sessionID, ctx) | ||
| } | ||
|
|
||
| ctx.emitLog({ | ||
| severityNumber: success ? SeverityNumber.INFO : SeverityNumber.ERROR, | ||
| severityText: success ? "INFO" : "ERROR", | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we match only
toolInput.commandhere? The command is the canonical bash input, while the model-provideddescriptioncan mentiongit commiteven when the executed command is something else (for example, a status or inspection command), which would produce a false commit count. The existing command match should be sufficient.