Repository navigation
pollers: skip own posts case-insensitively, self handle from config #59
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| // SPDX-License-Identifier: AGPL-3.0-only | ||
|
|
||
| /** | ||
| * Self-handle resolution and comparison, shared by every poller that must | ||
| * skip the agent's own posts. | ||
| * | ||
| * The comparison is case-insensitive and ignores a leading '@' on either | ||
| * side. This is load-bearing: GroupMind returns the handle's REGISTERED | ||
| * casing in message `from` fields (e.g. '@claudeMB') while configs usually | ||
| * hold the lowercase form ('@claudemb'). A case-sensitive filter silently | ||
| * passes every self-post, so each post the agent makes re-enters its own | ||
| * wake pipeline as a "new message" and burns a wake turn (observed on the | ||
| * MacBook poller, 2026-08-14). | ||
| */ | ||
|
|
||
| /** Normalize a handle for comparison: trim, drop leading '@', lowercase. */ | ||
| export function handleKey(handle) { | ||
| return String(handle ?? '').trim().replace(/^@/, '').toLowerCase(); | ||
| } | ||
|
|
||
| /** | ||
| * Resolve the agent's own GroupMind handle. | ||
| * Order: IAK_SELF_HANDLE env override, explicit value (CLI flag), then the | ||
| * agent config (poller.handle). | ||
| */ | ||
| export function resolveSelfHandle({ explicit, config } = {}) { | ||
| return process.env.IAK_SELF_HANDLE || explicit || config?.poller?.handle || '@unknown'; | ||
| } | ||
|
|
||
| /** True when `sender` is the agent itself (case- and '@'-insensitive). */ | ||
| export function isSelfSender(sender, selfHandle) { | ||
| const key = handleKey(selfHandle); | ||
| return key !== '' && handleKey(sender) === key; | ||
| } |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
When
ide-agent-kit automateposts an action and the API returns the sender using different casing, this new comparison is never executed becausebin/cli.mjsimportssrc/team-relay/room-automation.mjs, whose self check remains case-sensitive. An automation rule can therefore consume its own output and repeatedly fire another action; apply the same helper to the team-relay implementation or redirect the CLI to this implementation.Useful? React with 👍 / 👎.