Skip to content

slack: drop the eyes-emoji ack post; light the pill on the prior anchor#87

Merged
rogeriochaves merged 1 commit into
mainfrom
fix/slack-pill-no-eyes-ack
Jun 7, 2026
Merged

slack: drop the eyes-emoji ack post; light the pill on the prior anchor#87
rogeriochaves merged 1 commit into
mainfrom
fix/slack-pill-no-eyes-ack

Conversation

@rogeriochaves
Copy link
Copy Markdown
Contributor

Summary

  • Removes the 👀 bot post that PR slack: light working pill immediately when a Slack human relays a prompt #85 introduced as the pill anchor for Slack-relayed prompts. It was visible noise in every channel.
  • Reuses the most recent app-authored thread root for the slug (the prior turn's text post) as the setStatus anchor. The pill rides on that existing post until the agent's first reply in this turn lands, at which point the existing post loop drains buffered tools under the prior anchor and moves the pill onto the new narrative text. Same end-state, zero new posts.
  • First-ever interaction with an agent (no prior anchor): skips. The pill appears the natural way on the agent's first reply. One-time delay per agent install.

Test plan

  • All 242 existing CLI tests pass.
  • Box bridge restart on this branch: typing a prompt in an agent channel lights the working pill on the previous bot post within a second, no new bot message appears, and the pill migrates onto the agent's first real reply when it lands.
  • First interaction with a fresh agent: no pill until the agent's first reply, no errors in journalctl -u agents-slack-bridge.service.

See: #85 (eyes-emoji ack original) and #86 (codex turn-end pill drop).

… anchor

The previous relay path posted a 👀 bot message as the pill anchor so
assistant.threads.setStatus had something app-authored to attach to.
That works but adds a noise-only post to every Slack-relayed prompt,
which clutters the channel and looks like the bot is "saying" eyes.

Re-light the pill on the most recent app-authored thread root for the
slug instead (the previous turn's text post, persisted via writeThreadRoot
and surfaced by readThreadRoot). The pill is the visible signal of work
in progress; the prior reply is its natural anchor between turns and no
new message is needed. The agent's first text post in this turn then
becomes the new anchor via the existing post loop, draining buffered
tools under the prior anchor and moving the pill onto the narrative
text, same as before.

When there is no prior anchor (very first interaction with this agent),
skip: the pill appears the natural way on the agent's first reply. That
happens once per agent install, so the one-time delay is worth not
spamming a bot post.
@rogeriochaves rogeriochaves merged commit e753f3e into main Jun 7, 2026
1 check passed
rogeriochaves added a commit that referenced this pull request Jun 7, 2026
… reply

Bringing back the eyes anchor that PR #85 introduced and PR #87 dropped,
with the missing half: the ack message gets deleted from the channel the
moment the agent posts its first real reply. So the channel sees a
visible "received, working" beat in the 10-20s gap before the agent
replies, and the ack disappears as soon as the reply lands — no
persistent "👀" sitting under every relayed prompt forever.

Mechanics:
- The bridge posts "👀" as a bot message right after pasteTmuxPrompt and
  anchors the working pill on it via assistant.threads.setStatus.
- The ts is persisted to ~/.kanban-code/eyes-anchors/<slug> via
  eyes-anchor.ts (same atomic write pattern as active-pill /
  thread-root). A bridge restart in the gap between the ack and the
  agent's first reply still finds the record and finishes the cleanup
  on the next text post (or on the restore-time turn-ended check).
- The agent->slack post loop calls consumePendingEyes(slug) BEFORE
  posting any text reply, so the eyes message is gone in Slack by the
  time the human sees the new reply land — no flicker.
- Restore-time pill drop (the previous commit) also calls
  consumePendingEyes so a turn that ended without ever producing text
  doesn't orphan an eyes message in the channel.

Adds SlackClient.deleteMessage as a thin wrapper around chat.delete
(scope chat:write is already on the bot). 5 unit tests cover the
eyes-anchor persistence contract.
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