Conversation
Agents running under the dm-context-filter plugin could still discover other Discord channel IDs and route minion sessions there, even with the existing '## cross-project commands' section stripped. The section stripper missed three residual vectors: - '## reading other sessions' documented 'kimaki session list --project' and 'kimaki session search --channel <channel_id>'. - Stray 'kimaki project list|add|create' / 'kimaki send --project' / bare 'kimaki send --channel <channel_id>' examples in surviving sections (scheduled sends, opencode commands, etc.). - No positive instruction steering the agent back to the current channel once it learned a channel ID some other way (--help, training data, another agent's mention). This fix: 1. Strips '## reading other sessions' as a whole section. 2. Adds stripProjectDiscoveryInlines() to remove surviving kimaki project / --project / --channel <channel_id> lines. 3. Appends '## Minion Session Routing' with a positive instruction: all minion sessions stay in the current channel; --cwd targets a different repo directory without changing channels. Refs Extra-Chill/data-machine-code#49.
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
Agents running under the
dm-context-filterplugin could still discover other Discord channel IDs and spawn minion sessions there, violating the "one agent per Discord channel" boundary. Refs Extra-Chill/data-machine-code#49.The existing filter stripped the
## cross-project commandssection, but three residual vectors let channel IDs leak back into the system prompt:## reading other sessions— documentedkimaki session list --project /path/to/projectandkimaki session search --channel <channel_id>. Direct project-and-channel discovery surface.kimaki project list|add|create,kimaki send --project, and barekimaki send --channel <channel_id>examples scattered across surviving sections (scheduled sends, opencode commands, handoff instructions).kimaki --help, another agent mentioning it), nothing told it not to use that ID.What this PR changes
kimaki/plugins/dm-context-filter.ts:## reading other sessionsas a whole section. On a single-project fleet server the agent only ever needskimaki session list(no flags) for the current project — the flag-heavy documentation is pure leakage.stripProjectDiscoveryInlines()to catch surviving lines that referencekimaki project list|add|create,kimaki send --project <dir>, orkimaki send --channel <channel_id>(literal placeholder — the current-channel\${channelId}form is substituted to a concrete numeric ID before the plugin runs, so it never matches and stays intact).## Minion Session Routingat the end of the system prompt. Positive defense-in-depth instruction: all minion sessions stay in the current channel; cross-repo work useskimaki send --cwd /path/to/repo(same channel, different checkout) or Data Machine Code's workspace worktrees.Updated the header comment block to document items 10 and 11 (reading-other-sessions + project-discovery inlines) and the new positive-injection behavior.
Verification
kimaki/cli/src/system-message.ts(line 635 forsession search --channel <channel_id>, lines 652-670 for the## cross-project commandsblock, line 667 forkimaki send --channel <channel_id>).\${channelId}template variable is substituted beforeexperimental.chat.system.transformruns, so the current session's baked-in channel ID (numeric, e.g.1493345787894038649) does not match the<channel_id>placeholder regex — current-channel examples in## starting new sessions from CLIare preserved.kimaki <verb>to avoid mangling prose that happens to mention--projector--channel.AI assistance
stripProjectDiscoveryInlines,appendMinionRoutingInstruction), updated the header-comment block, and composed this PR body. Chris reviewed the regex patterns against the actual system-prompt source inkimaki/cli/src/system-message.tsand verified the existing filter coverage before adding the new strips.