fix(local-agent): pass --agent filter to initLocalAgentHttp to prevent cross-tool hook injection#174
Merged
jeff-r2026 merged 3 commits intoJul 9, 2026
Conversation
…t cross-tool hook injection When `teamai init --http --agent codebuddy` is run on a machine that also has WorkBuddy installed, initLocalAgentHttp previously injected hooks into ALL tool directories unconditionally. This caused CodeBuddy sessions to trigger WorkBuddy report/sync as well, producing duplicate agent cards on ClawPro. Thread the existing filterAgents (from --agent CLI flag) through to injectHooksToAllTools so only the target tool receives hooks. --story=1032029153857553 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
d2f9b5c to
5c17fb8
Compare
…etry queue
appendReporterQueue wrote {at, entry:{error, context}} into the same
queue.jsonl that status-report's flushQueue expects {url, body} entries.
These orphaned entries could never be drained and accumulated forever.
Rename to errors.jsonl so the retry queue stays clean.
--story=1032029153857553
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…arity The function writes diagnostic error entries (not retryable requests), so the name should reflect its actual purpose. --story=1032029153857553 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
filterAgents(from--agentCLI flag) throughinitLocalAgentHttptoinjectHooksToAllToolsteamai init --http <url> --agent codebuddyfrom injecting hooks into.workbuddy/settings.json(and vice versa)Root Cause
initLocalAgentHttpcalledinjectHooksToAllToolswithout afilterAgentsparameter, so it injected hooks into every tool directory that existed on disk. When CodeBuddy IDE triggered a session-start hook, both.codebuddy/settings.jsonand.workbuddy/settings.jsonhooks fired, causing two separate report/sync cycles with differentagent_typeandlocal_agent_id.Test plan
teamai init --http <url> --agent codebuddyonly injects hooks into.codebuddy/settings.jsonteamai init --http <url>(no --agent) still injects hooks into all existing tool directories (backward compatible)npx tsc --noEmitpassesnpx vitest run— no new test failures🤖 Generated with Claude Code