Repository navigation
Conversation
…hread (ent#224) The reported failure: a user asks in Slack, the agent delegates a ~10-minute job to another agent, the job succeeds — and nobody tells the user. The trigger side worked; the completion side died silently. Two things were actually missing, and both are fixed here: 1. Channel context did not survive delegation. The A->B path never forwarded source_channel*, so B's row had no destination and B's terminal had nowhere to report. ParallelTaskRequest gains parent_execution_id; chat_execution_service copies the parent's channel/chat/thread down to the child (fail-open — a miss changes nothing). MCP chat_with_agent gains an optional execution_id so a delegating agent can pass its own execution, mirroring the #1084 effect tools. 2. Nothing reported at the terminal. channel_completion_report posts the outcome to the originating channel/thread, hooked at both CAS-won terminal chokepoints beside spawn_task_terminal_event (#1578) — success AND failure, because a silent failure is the bug being closed. The no-double-post rule is the load-bearing part: a direct channel turn is synchronous and the adapter already replies inline, and those rows carry triggered_by == the channel name. Reporting them would duplicate every normal Slack reply in a customer workspace, so we report ONLY when the context was INHERITED (triggered_by not in {slack, telegram, whatsapp}). Gated by ent#223 per-channel consent, at-most-once via effect_guard (#1084) keyed on the resolved destination (never the generated body), Slack-only in v1, and fail-soft throughout — a reporting failure never disturbs an execution that already completed and was billed. 12 unit tests: the double-post guard across all three channel triggers, delegated reporting into the right thread, consent + unbound gates, no-context/non-Slack/ missing-row no-ops, failure terminals reporting, replay not re-posting, and the never-raises guarantee. Related to ent#224
Contributor
Author
|
Superseded by #1763, which consolidates all three Slack partner follow-ups (ent#222 / ent#223 / ent#224) into a single OSS PR — they share a migration chain and ent#224 is gated by ent#223's consent flag, so reviewing them separately was artificial. Every commit from this branch is included there, plus the Alembic head fix. The enterprise half stays in trinity-enterprise#232 (repo boundary). |
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.
Closes the partner scenario from the 2026-07-23 call: user asks in Slack → agent delegates a ~10-minute job → job succeeds → nobody tells the user.
The issue called this "a join". It wasn't — two things were missing
source_channel*, so B's row had no destination.ParallelTaskRequestgainsparent_execution_id;chat_execution_servicecopies the parent's channel/chat/thread down (fail-open). MCPchat_with_agentgains an optionalexecution_id, mirroring the feat: effect-scoped idempotency keys for outbound side effects #1084 effect tools.channel_completion_reportposts the outcome to the originating channel/thread, hooked at both CAS-won chokepoints besidespawn_task_terminal_event(feat: system-emitted agent.task.completed/failed events at execution terminal (async caller report-back) #1578) — success and failure, since a silent failure is the bug.A direct channel turn is synchronous and already replies inline, and those rows carry
triggered_by== the channel name. Reporting them would duplicate every normal Slack reply in a customer workspace. So we report only when the context was INHERITED (triggered_bynot in{slack, telegram, whatsapp}). That single condition is what keeps this from spamming the partner.Also: ent#223 consent-gated · at-most-once via
effect_guard(#1084) keyed on the resolved destination, never the generated body · Slack-only in v1 · fail-soft (a reporting failure never disturbs an execution that already completed and was billed).Tests — 12, green
Double-post guard across all three channel triggers · delegated reporting into the right thread · consent + unbound gates · no-context / non-Slack / missing-row no-ops · failure terminals report · replay doesn't re-post · never-raises.
Honest limits
send_message_detailed) is the same one bug: proactive group messages (send_group_message) never persisted to channel session history #1649 already uses in production, but an end-to-end run needs a real workspace.execution_idwhen delegating and the channel has consent enabled.Related to ent#224 · needs #1761
🤖 Generated with Claude Code