fix: only check last message for agent call #741
Closed
mhuggins7278 wants to merge 3 commits into
Closed
Conversation
Member
|
we can get this merged if you can rebase |
…ves agent call detection by only checking the last message role, reducing false positives.\n\n🤖 Generated with [opencode](https://opencode.ai)\n\nCo-Authored-By: opencode <noreply@opencode.ai>
mhuggins7278
force-pushed
the
copilot-agent-fixes
branch
from
July 9, 2025 16:54
9108526 to
ec73a4c
Compare
Contributor
Author
|
done |
no need for the nested if here
teamgroove
pushed a commit
to teamgroove/opencode
that referenced
this pull request
Aug 3, 2025
Merged from: anomalyco#741 Author: @mhuggins7278 Auto-merged by opencode-fork integration system
danriedl
suggested changes
Aug 7, 2025
danriedl
left a comment
There was a problem hiding this comment.
I'd propose a rebase because of the fix commit.
| const lastMessage = body.messages[body.messages.length - 1] | ||
| isAgentCall = lastMessage.role && ["tool", "assistant"].includes(lastMessage.role) | ||
| //NOTE: Should this also use lastMessage or given the vision | ||
| //flow does this even matter |
Contributor
Author
|
@adamdotdevin I rebased this a while ago. Still something I think should be merged. I would hate to get the tool blacklisted. Currently only user requests up to the first tool call are getting counted as usage against the GH premium request limits. |
andreipromarketing-dev
pushed a commit
to andreipromarketing-dev/opencode
that referenced
this pull request
Apr 7, 2026
…o#741) * fix(hooks): collapse multi-line commands in bash audit logs Add gsub("\\n"; " ") to jq filters in bash audit log and cost-tracker hooks so multi-line commands produce single-line log entries, preventing breakage in downstream line-based parsing. Fixes anomalyco#734 * fix: forward stdin to downstream hooks using echo pattern Addresses review feedback: PostToolUse hooks now preserve stdin for subsequent hooks by echoing $INPUT back to stdout after processing. Changed ; to && for proper error propagation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: make stdin passthrough unconditional and broaden secret redaction - Use semicolons instead of && so printf passthrough always runs even if jq fails - Add || true after jq to prevent non-zero exit on parse errors - Use printf '%s\n' instead of echo for safe binary passthrough - Fix Authorization pattern to handle 'Bearer <token>' with space - Add ASIA (STS temp credentials) alongside AKIA redaction - Add GitHub token patterns (ghp_, gho_, ghs_, github_pat_) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: use [: ]* instead of s* for Authorization whitespace matching jq's ONIG regex engine interprets s* as literal 's' zero-or-more, not \s* (whitespace). This caused 'Authorization: Bearer <token>' to only redact 'Authorization:' and leak the actual token. Using [: ]* avoids the JSON/jq double-escape issue entirely and correctly matches both 'Authorization: Bearer xyz' and 'Authorization:xyz' patterns. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
bussard76
pushed a commit
to bussard76/openwork
that referenced
this pull request
May 12, 2026
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.
This improves agent call detection by only checking the last message role, reducing false positives.
🤖 Generated with opencode
Co-Authored-By: opencode noreply@opencode.ai