Repository navigation
fix(skill-gate): the person who asked sees how a gated request ended (#3653) - #3657
Conversation
…3653) An agent that requests a gated skill while answering someone in a conversation is woken with the outcome and writes a reply. The wake-up run carried no channel context, so that reply reached no conversation. - `enforce` records the chat the requesting agent's turn is answering (`_requester_chat`), under `REQUESTER_CHAT` in the record's `dispatch`. It is recorded only while that turn is the agent's own and still running, the rule channel inheritance already uses: an agent can cite any of its past turns, and a finished one would address the outcome to whoever that turn was for. - Every wake-up that reports an ending (denied, expired, stale, not run, succeeded, failed) runs with that context, so `channel_completion_report` posts the requester's reply into the conversation like any background completion. The "approved, now running" wake-up carries none. - `execute_task` accepts and persists `source_channel_agent`, so the wake-up row reads as delegated work for the file-share audience and the voice route, and Slack/Telegram deliver through the binding the person addressed. No migration: the context rides the existing `dispatch` JSON and is never replayed to the approved run. Fixes #3653 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…#3653) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
/review + /validate-prVerdict: APPROVE. No critical findings. The merge order with #3658 doesn't matter (see Interaction). /review (structural)Scope: clean. For #3653, every wake-up that reports an ending runs in the chat the requesting agent was answering. Execution coverage
Informational
Low confidence: no test drives a Interaction with #3658
/validate-prLane B (no schema), 10 files (+341/−7), 2 commits, head
Testing note: the author of this PR also owns the release-test row that re-tests it (A2 on abilityai/trinity-enterprise#847). That re-test needs a different tester for these legs. |
webmixgamer
left a comment
There was a problem hiding this comment.
Approving: no critical findings; the /review + /validate-pr report is in the comment above. The merge order with #3658 doesn't matter: whichever lands second keeps both rows in the skill-gate.md test table. The three informational items can be follow-ups.
…text (#3657) — mechanical, per the merge-train note on the PR Resolves the adjacent-line collision with #3684 (ent#885) in skill_gate_service.DISPATCH_FIELDS and task_execution_service.execute_task: #3684 removed the source_host lines, this PR adds source_channel_agent beside them. Resolution keeps source_channel_agent and drops source_host, matching dev. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
merge-train (2026-10-14): pushed one merge commit to this branch — Validated at |
…shed" (#3688) (#3757) After #3657 the requester is woken (triggered_by="skill_gate") with how its gated request ended, and the reply is reported into the Workspace thread it came from. _portal_body chose its header, and _portal_source its pill, from the wake-up row's own run status, which completes normally for a rejected, expired or not-run request. The reader saw a "Finished" header and a green "Finished" pill above "Your request was rejected." A skill_gate row that completed now gets the header "Approval update" and the source completion:notice, which shows no outcome pill and is narrated as a background report. One predicate decides both, so the header and the pill cannot disagree. A wake-up that itself failed still reads "Didn't finish"; the approved run keeps its requester's trigger and still reads "Finished". triggered_by is passed to every resolver, per the shared call shape. Fixes #3688 Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Summary
skill_gate_service.enforcenow records the chat the requesting agent's turn is answering, at request time, only while that turn is the agent's own and stillrunning(the rule_inherited_channel_contextuses).channel_completion_reportposts the requester's reply into the conversation. The "approved, now running" wake-up carries none.Changes
src/backend/services/skill_gate_service.py:REQUESTER_CHAT,_requester_chat,_wake_requester_agent(to_chat=);source_channel_agentclassifiedDROPinDISPATCH_FIELDS.src/backend/services/task_execution_service.py:execute_taskaccepts and persistssource_channel_agent.src/backend/services/turn_audience.py,src/backend/routers/agents.py: comments naming the writers ofsource_channel_agent.tests/unit/test_3653_gate_wake_channel_context.py(new), two test stubs accept the new keyword.docs/memory/feature-flows/skill-gate.md.No migration. The context rides the record's existing
dispatchJSON and is never replayed to the approved run.Behaviour a reviewer should know
source_channel_agent, so it reads as delegated work: file shares in it are owner-only and the voice route answersdelegated_turn.Test Plan
cd tests && pytest unit/test_3653_gate_wake_channel_context.py -v(8 pass; 5 fail without the fix)TestPaidA2A(3) andtest_ent679_a2a_payment_gate.pyfail on the untouched base in the author's environment (payments_pyimport); CI is the reference for those.Fixes #3653
🤖 Generated with Claude Code