Repository navigation
feat(timeline): show what an item caused, with Approve and Decline on waiting approvals - #642
Merged
Merged
Conversation
… waiting approvals
An opened item lists the automation runs it started (of the automations the
person manages) and the approvals those runs asked them for, with Approve and
Decline on the ones still waiting, so the pick is made where it was caused;
an approval's own line lists that approval. GET /activities/{id}/caused and
the MCP tool activity_caused read the same for agents, and approvals (API,
MCP, the assistant) takes the activity that caused them.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ln25ykE6uBDqx21WBU94SX
Merged
21 of 23 tasks
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.
Requested by Adeel · project thread
Description
Before: an opened timeline item said which run caused it, but nothing about what it caused. To see that an email had started "School emails" and left a post waiting for a yes, you filtered the timeline by the automation or went to the Approvals page, and decided it there.
After: an opened item shows What this caused: each automation run it started (of the automations you manage, with its status and a link to the automation's runs) and each approval those runs asked you for, with what it would do and its status. An approval still waiting has Approve and Decline right there, so the pick is made where it was caused; an approval's own line ("School emails asks for your pick") lists that approval under Your pick. Items that caused nothing show no block. Agents read the same:
GET /api/v1/activities/{id}/causedis{runs, approvals}with each approval'scan, the MCP toolactivity_causedreturns it asapprovalsshows them, andapprovals(API, MCP and the assistant) takesactivityto list the approvals one item led to. Approving stays the person's: an agent lists and declines, as before.How:
approvals.listinggains anactivityfilter onwhy.activity(the activity an approval was asked about, already kept); the runs come fromautomations.causedthrough the same manage check asGET /automations/runs?activity=, now a sharedcaused_runs. The page'sCausedcomponent reads/causedwhen an item is opened and decides through the existingPOST /api/v1/approvals/{id}, then reloads the approvals badge, the item and the timeline.Motivation and Context
Step 9 of the activity stream design (thread above), and docs/timeline.md's last planned row: "What each item caused (automation runs, approvals), and Approve and Decline on waiting approvals". Follows #570, #622, #627, #631, #635 and #637.
Types of changes
!in the title)Checklist:
make hookschecks it on commit).docs/accordingly.changelog.d/(timeline-caused.md).Done questions (AGENTS.md)
GET /api/v1/activities/{id}/caused,GET /api/v1/approvals?activity=, MCPactivity_causedandapprovals(activity), the assistant'sapprovals(activity).canrules (approving needs a signed-in session). No new surface for the threat model.test_timeline_caused.py(runs and approvals by item, the approvals filter, the approval's own line, another reader sees neither, a stranger gets 404, decline from the item; MCPactivity_causedandapprovals, the assistant); jesttimeline-ui.test.tsx(the block, the run link, Approve posting the decision); docs timeline.md (What an item caused), mcp.md, assistant.md, automations.md, requirements.md, changelog.d;make openapiregenerated the client.automations.caused,approvals.listingandapproval_view, the approvals hook and badge, the automations page's run status and counts helpers, and the existing decide endpoint; no new machinery.Local CI (
ci/local-ci.sh) on this head: running; CI on the PR decides the merge.Generated by Claude Code