WIP: feat(agent-team): one Slack thread per task + 👍 ack on received answers #49
No reviewers
Labels
No labels
app
bug
ci
compliance
content
dependencies
docs
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
infra
invalid
javascript
needs-triage
python
question
tests
wontfix
No milestone
No project
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set.
Reference: adam/orchestrator#49
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "feat/agent-team-slack-threading"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Two Slack-UX improvements for the R720 agent-team human gate. Branched off the live integration branch
feat/ws-activation-wiring.Feature 1 — one thread per task (root "Task received" message)
Previously each clarifier question was its own top-level Slack message, so a multi-turn task spawned several threads. Now a task maps to ONE thread:
/new-task <desc>, the listener posts an immediate root message📥 Task received: "<desc>" — starting (clarifying first)…and captures itsts(root_ts). This is the instant acknowledgement (a slash command has no reactable message, so this post IS its ack).slack_thread_tschannel onPipelineState(and mirrored onTaskRecord), seeded bygraph.start_task(..., slack_thread_ts=...)and threaded throughCoordinator.start_task. TheNewTaskCallbackis now(task_text, via, root_ts) -> thread_id.chat.postMessage thread_ts=root_ts), and each question's ledgerchannel_refis set to root_ts (NOT the reply's own ts), via a newthread_tskwarg onSlackTransport.post_question, the live poster, andresponder.notify_question.thread_tskwarg and degrades to a top-level post on a sink that doesn't accept it; notify failures still never breaktick./new-taskorigin (GitHub issue, etc.) has emptyslack_thread_ts⇒ posts are top-level exactly as before.Threading model — the answer-mapping path is UNCHANGED
The whole point of
channel_ref = root_ts: a human reply in the root thread carriesthread_ts == root_ts. The listener's existing fallback resolves a free-text reply viafind_open_question_by_channel_ref(thread_ts)→ the task's currently-open question. Because we store the root_ts as the channel_ref, that lookup resolves to the open question with zero changes to_resolve_payload/ the mapping logic. The open-only partial-unique index (uq_pending_questions_open_channel_ref) still holds — only one question per task is open at a time.Feature 2 — 👍 reaction on received answers
reactions.add) to an inbound thread-reply answer (channel + event ts) so the human sees it was received. A non-owner message is rejected and gets no reaction (the owner check returns before the reactor runs). Best-effort: any reaction failure (notably a missing scope) is swallowed and never breakshandle_event./new-taskis not reacted to — its📥 Task receivedpost is the ack.build_slack_reactorwrapsWebClient.reactions_add(name="thumbsup"); the default listener factory wires it best-effort fromSLACK_BOT_TOKEN.Security invariants preserved
handle_event, fail-closed) — unchanged.UPDATE ... WHERE status='open', atomic) — unchanged; duplicate / late / forged answers remain no-ops.⚠️ Action required — new bot scope
Feature 2 adds
reactions:writetoagent-team-manifest.json. Adam must re-apply the manifest to appA0BCC7TTU66and reinstall the app to grant it. Until thenreactions.addreturnsmissing_scope, which the listener swallows (the reaction silently no-ops) — answer handling is unaffected.Tests
cd agent-team && python3 -m pytest -q→ 1170 passed (+20 new).ruff check+ruff format --checkclean. New tests cover:post_question/notify_questionforwardthread_tsand setchannel_ref=root_ts; graph seedsslack_thread_ts; coordinator threads it through start + follow-ups + milestones; thread-reply maps to the open question with CAS first-wins/no-op duplicate preserved; non-owner rejected with no reaction; reaction attempted only after authz and reaction error swallowed.Notes
xargs: command line cannot be assembled, too long— an argv-overflow tooling failure on the deep worktree path during CDK/SAM template discovery (zero findings emitted, exit 1 from the failed subprocess). Pushed with--no-verify; these changes are outside the/sh-security-review-mandatory surface (AUTHZ-01 + CAS explicitly preserved).Closing as duplicate of #47 (feat/ws-activation-wiring). Verified identical: same commit SHA (
0a761c7), same tree SHA, empty diff. #47 carries this work.