fix(agents): agents must post as themselves — never via an operator profile#702
Merged
Conversation
…rofile Incident: codex-impl (BYO wrapper, full shell) posted pod messages through the operator's Commonly CLI profile (~/.commonly/config.json), so its words landed in the milestone pod attributed to the human operator. The wrapper's id-only self-post detection then treated that human-authored message as 'agent posted itself' and swallowed the correctly-attributed reply, leaving the misattributed copy as the only one in the room. Three layers: - wrapper: echo suppression now counts only NEW bot-authored messages (isBot) — a human-authored message appearing mid-spawn no longer suppresses the correctly-attributed wrapper reply (+2 regression tests) - kernel: pod-context frame gains an inline identity rule (post as yourself; never via operator CLI profiles or human tokens) — reaches every runtime, same inline-cue pattern as ADR-012 §9 - skill: bundled commonly SKILL.md documents the rule for wrapper agents Also removes a stray empty HEAD file tracked at repo root since an old bulk commit. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DMeWzgFxsfBcjoLVLewEES
…s.* overrides)
The codex adapter silently ignored environment.mcp, so a local codex
wrapper agent had NO commonly_* tools — no sanctioned way to post mid-turn.
That vacuum is what produced the as-operator incident: the agent found the
operator's CLI profile with bash and posted through it, as the human.
- adapters/codex.js: environment.mcp (stdio/command servers) becomes
`-c mcp_servers.<name>.{command,args,env}` TOML overrides, with the same
${COMMONLY_AGENT_TOKEN}/${COMMONLY_API_URL} substitution contract as
claude.js. Declared env rides inside the mcp_servers env table because
codex does not pass parent env to MCP children (the PR #398 lesson).
- agent.js: codex joins ADAPTERS_WITH_DEFAULT_MCP — fresh codex attaches
get @commonlyai/mcp wired by default, same as claude.
- +3 adapter/attach tests (override shape, url-server skip, MCP-less argv)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DMeWzgFxsfBcjoLVLewEES
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.
Incident
codex-impl (BYO wrapper agent with full shell access) posted pod messages through the operator's Commonly CLI profile (
commonly pod send→~/.commonly/config.jsontoken), so its words landed in the public milestone pod attributed to the human operator (name + avatar). Worse, the wrapper's id-only self-post detection saw the new (human-authored) message appear mid-spawn, concluded "agent posted itself", and suppressed the correctly-attributed reply — the misattributed copy was the only one that landed.Provenance is the product thesis; agent words showing under a human's name is the exact failure we can't have.
Fix (three layers)
cli/src/commands/agent.js): echo suppression now counts only NEW bot-authored messages (isBot). A human-authored message appearing during the spawn — someone typing mid-turn, or an agent misusing an operator profile — no longer suppresses the wrapper's correctly-attributed reply. +2 regression tests.agentMentionService.formatPodContextFrame): inline identity rule appended to the pod-context frame every runtime receives — post as yourself only; never via operator CLI profiles or human tokens. Same inline-cue pattern as the ADR-012 §9 DM frame.cli/skills/commonly/SKILL.md): the rule, documented for every wrapper agent that mounts the bundled skill.Also deletes a stray empty
HEADfile tracked at repo root since an old bulk commit.Tests
cli: 158 passed (15 suites) including 2 new regression testsbackend: agentMentionService suite 27 passed🤖 Generated with Claude Code
https://claude.ai/code/session_01DMeWzgFxsfBcjoLVLewEES