agents: drop redundant agent-name headers from comments (+ fix self-trigger loop) #66

Merged
ffaerber merged 1 commits from fix/comment-headers into main 2026-07-05 17:02:34 +02:00
Owner

Gitea already shows who authored each comment/PR, so the 🤖 **@name** / 🔨 **@name** header at the top of every agent comment was redundant. Remove it everywhere — and fix a self-trigger loop it was hiding.

Changes

  • publish.shpost()/prpost() now append a hidden <!-- 🤖 … --> marker instead of each message carrying a visible 🤖 **@name** header. The trigger gate keys on the 🤖 char to skip an agent's own replies, so the marker keeps loop-prevention while being invisible. All reply/status/autopilot strings drop the name header.
  • route.sh — the "building on branch" notice is posted with the agent's PAT and previously had no 🤖 marker plus an @name mention, so it re-triggered the same agent (the loop seen on issue #139). Reworded without the self-name + hidden marker so it can't fire a run.
  • publish.sh — broaden the leading self-header stripper to drop any leading line referencing the agent's own @handle (e.g. ## 🔨 @senior — …), not just bare **@name** lines. Legit headings like ## Summary are preserved (verified).
  • run-agent.sh — instruct the model not to begin its reply with its own name/handle.

Trigger comments (delegation / autopilot / bounce) stay marker-free by design, so delegation still fires.

Result: cleaner comments (no repeated agent name), and agent status comments can no longer self-trigger.

Gitea already shows who authored each comment/PR, so the `🤖 **@name**` / `🔨 **@name**` header at the top of every agent comment was redundant. Remove it everywhere — and fix a self-trigger loop it was hiding. ## Changes - **publish.sh** — `post()`/`prpost()` now append a hidden `<!-- 🤖 … -->` marker instead of each message carrying a visible `🤖 **@name**` header. The trigger gate keys on the `🤖` char to skip an agent's own replies, so the marker keeps loop-prevention while being invisible. All reply/status/autopilot strings drop the name header. - **route.sh** — the "building on branch" notice is posted with the agent's **PAT** and previously had **no** `🤖` marker plus an `@name` mention, so it re-triggered the same agent (the loop seen on issue #139). Reworded without the self-name + hidden marker so it can't fire a run. - **publish.sh** — broaden the leading self-header stripper to drop any leading line referencing the agent's own `@handle` (e.g. `## 🔨 @senior — …`), not just bare `**@name**` lines. Legit headings like `## Summary` are preserved (verified). - **run-agent.sh** — instruct the model not to begin its reply with its own name/handle. Trigger comments (delegation / autopilot / bounce) stay marker-free by design, so delegation still fires. Result: cleaner comments (no repeated agent name), and agent status comments can no longer self-trigger.
ffaerber added 1 commit 2026-07-05 17:01:17 +02:00
Gitea already attributes every comment/PR to its author, so the "🤖 **@name**" /
"🔨 **@name**" header at the top of agent comments was redundant noise. Remove it
everywhere and, in the process, close a self-trigger loop.

- publish.sh: post()/prpost() now append a hidden `<!-- 🤖 … -->` marker instead
  of each message carrying a visible "🤖 **@name**" header. The gate keys on the
  '🤖' char to skip agent replies, so the marker preserves loop-prevention while
  being invisible. All reply/status/autopilot strings drop the name header.
- route.sh: the "building on branch" notice is posted with the agent's PAT and
  previously had NO 🤖 marker + an "@name" mention, so it re-triggered the agent
  (the observed loop on issue #139). Reword without the self-name and add the
  hidden marker so it can't fire a new run.
- publish.sh: broaden the leading self-header stripper to drop any leading line
  referencing the agent's own @handle (e.g. "## 🔨 @senior — …"), not just bare
  "**@name**" lines. Legit headings like "## Summary" are preserved.
- run-agent.sh: tell the model not to begin its reply with its own name/handle.
- Trigger comments (delegation / autopilot / bounce) stay marker-free by design,
  so they still fire the next agent.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ffaerber merged commit 62c86e77b0 into main 2026-07-05 17:02:34 +02:00
ffaerber deleted branch fix/comment-headers 2026-07-05 17:02:35 +02:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: gitea/agents#66