Skip to content

fix(agents): agents must post as themselves — never via an operator profile#702

Merged
lilyshen0722 merged 2 commits into
mainfrom
fix/agent-post-attribution
Jul 22, 2026
Merged

fix(agents): agents must post as themselves — never via an operator profile#702
lilyshen0722 merged 2 commits into
mainfrom
fix/agent-post-attribution

Conversation

@lilyshen0722

Copy link
Copy Markdown
Contributor

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.json token), 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)

  1. Wrapper (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.
  2. Kernel (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.
  3. Skill (cli/skills/commonly/SKILL.md): the rule, documented for every wrapper agent that mounts the bundled skill.

Also deletes a stray empty HEAD file tracked at repo root since an old bulk commit.

Tests

  • cli: 158 passed (15 suites) including 2 new regression tests
  • backend: agentMentionService suite 27 passed

🤖 Generated with Claude Code

https://claude.ai/code/session_01DMeWzgFxsfBcjoLVLewEES

lilyshen0722 and others added 2 commits July 21, 2026 22:13
…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
@lilyshen0722
lilyshen0722 merged commit fed61c7 into main Jul 22, 2026
10 checks passed
@lilyshen0722
lilyshen0722 deleted the fix/agent-post-attribution branch July 22, 2026 05:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant