Repository navigation
feat(chat): show what an agent's runs took live, and what they did, on its page - #2148
Merged
Merged
Conversation
… ship-row read Reports' outcome pill colors, "Pending · early signal" label and signed numbers move to components/reports/impact-parts.ts, and the ship_events embed (action number, measurement) and measurementOf to lib/impact/report.ts, so the agent page's "What this agent did" shows a change exactly as Reports does. Reports reads and renders as before. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SvzkMf5TZg7yqwaSeMFba9
GET /api/chat/agents/{id}/impact answers the agent's ship events of the
last 30 days (agent_id) with their measurements, read by Reports' own
impactRow and impactSummary (Improved counts Medium and High verdicts
only), on the brands the person may see as the ledger's policy (00424)
has it. Each change says how it went live (on its own, the reader
approved it, or a teammate) and its run's number among the agent's runs
the person sees, with the run's chat when they may open it. It also
counts the drafts the agent's runs of the last 30 days made that no ship
event names, found through the draft's chat: content_drafts.conversation_id
-> chat_conversations.agent_run_id -> chat_agent_runs.agent_id.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SvzkMf5TZg7yqwaSeMFba9
Between Triggers and Run history, as the owner approved it: the last 30
days, with no period to pick. Changes shipped, Improved X of Y (Medium
and High verdicts only, "—" before any) and Pending; each change with
how it went live ("run #31, on its own", "you approved", "by Sam Lee"),
its outcome in Reports' words and its next checkpoint; how many drafts
aren't live yet; the method line and Open in Reports, as Reports has no
link to one change. Three states: with results, the first week, and
nothing live yet.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SvzkMf5TZg7yqwaSeMFba9
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SvzkMf5TZg7yqwaSeMFba9
…t-card Brings in ansvisor#2134, ansvisor#2135, ansvisor#2136 (the Onboarding & Help agent) and ansvisor#2137 (impact-ledger ship credit, 00480). Conflict in help/chat/agents.md: both sides added a section after "An agent's page". Kept both, "What this agent did" (this branch) then "What a run's outcome means" (ansvisor#2137), in the page's order; each stays under 150 words. impact-report.tsx merged cleanly: ansvisor#2137's taken_down reason in REASONS beside this branch's move of the pills, outcome words and signed numbers to impact-parts.ts. approved-articles.json regenerated. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SvzkMf5TZg7yqwaSeMFba9
…ites
A person's click on a card in an agent run's chat now ships with the
agent and its run (00480, ship.js agentOrigin), execution_mode assisted
and shipped_by the person; the agent's own send stays automated. The card
already reads automated as "on its own" and the rest by who sent it, so
nothing changes in the read: the tests now use that data. Each change in
the credit test names its run, a page sent later from the Content Editor
or the Library (no agent) isn't listed, and the agent's own change reads
"on its own" to every viewer. The card's fixtures ship "you approved" and
"by {name}" rows as assisted, and a page taken down shows ansvisor#2137's reason.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SvzkMf5TZg7yqwaSeMFba9
…ange went live Agent Center's article gets keywords and synonyms for the agent page's card (what this agent did, agent impact, what did my agent do), now that ansvisor#2136's Onboarding & Help keywords are on main, and its section says the three ways a change went live: on its own, you approved on a card in the run's chat (00480), or by a teammate. Sources name agent-impact.ts. approved-articles.json follows. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SvzkMf5TZg7yqwaSeMFba9
gkhngyk
approved these changes
Nov 5, 2026
gkhngyk
left a comment
Contributor
There was a problem hiding this comment.
LGTM. Non-blocking: numberedRuns (agent-impact.ts) pages runs oldest-first from the oldest shipped run and stops at RUNS_MAX, so an agent with >10k runs since then drops its newest runs and draftsNotLive under-counts. Reading the 30-day window on its own would avoid it.
8 of 13 tasks
cihan-gyk
pushed a commit
to cihan-gyk/ansvisor
that referenced
this pull request
Nov 5, 2026
Main brought ansvisor#2146, ansvisor#2148 and ansvisor#2149. help/chat/agents.md's front matter keeps both keyword and synonym lists; approved-articles.json regenerated; schema.sql rebuilt. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SvzkMf5TZg7yqwaSeMFba9
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.
Summary
This PR adds the "What this agent did" card to the agent page, between Triggers and Run history (AGENTS-plan §2 rule 1, §7 step 2). The owner approved the card's mockup and decided its open questions:
The card has three states
Each row shows
Below the rows
reports.impact.method.*: "Baseline: 14 days before ship · Control: untouched similar prompts · Min. change: 3 pts · Correlation, not causation".Data
GET /api/chat/agents/{id}/impact, sits next to/runsand is called the same way (chatActor,agentContextFor). It returns 404 unless the person can see the agent.lib/chat/agent-impact.tsreads the agent'sship_events(agent_id,ship_events_agent_idx) from the last 30 days, with theirimpact_measurements.brand_idin their brand access. This is the same rule as the ledger's policy (00424,user_brand_ids()).impactRow, and the headline throughimpactSummary. Nothing about outcome or confidence is decided again here.Run numbers: a run's number is its place among the agent's runs the person can see, oldest first, so it matches what Run history shows them.
Drafts that aren't live
content_drafts.conversation_id→chat_conversations.agent_run_id→chat_agent_runs.agent_id.origin = 'agent'would miss."You approved" comes from #2137, now merged
feat(impact-ledger): credit a page a person approved in an agent run to that run (00480) #2137 (migration 00480) credits a page that a person sends or publishes from a card in an agent run's chat to that run.
agent_id,agent_run_id), withexecution_mode = 'assisted'and the person inshipped_by.automated.The card's rule:
execution_mode = automated→ on its own;shipped_bycan't decide "on its own", because an agent's own send records the person the run acts as.The rule was checked against feat(impact-ledger): credit a page a person approved in an agent run to that run (00480) #2137's
ship.js(agentOrigin,shipCmsPublish), and the read needed no change.The tests use feat(impact-ledger): credit a page a person approved in an agent run to that run (00480) #2137's data:
assisted.Reuse, no second copy
impact-report.tsxtocomponents/reports/impact-parts.ts, which both Reports and the card import.REASONSstays where it is, now with feat(impact-ledger): credit a page a person approved in an agent run to that run (00480) #2137'staken_down. The card reads reasons witht.has, so it also shows feat(impact-ledger): credit a page a person approved in an agent run to that run (00480) #2137's "The page was taken down from your site." (tested).measurementOfmoved tolib/impact/report.ts. Reports' server action uses them too.visibleAgentandnamesOfinlib/chat/agents.tsare now exported.One known gap, on the demo brand only: its sample agents have no ship events, because the demo never publishes (
coverage.js). So their card shows "Nothing from this agent has gone live yet", while one sample run in Run history shows Improved · Medium. This PR doesn't change demo data.Help:
help/chat/agents.mdagent-impact.tsis added to its sources.approved-articles.jsonis regenerated.Related issue
None. AGENTS-plan §7 step 2. The owner approved this card's mockup. The "you approved" rows come from #2137 (merged).
Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsHow to test
CHAT_AGENTIC), open an agent's page in Agent Center. What this agent did sits between Triggers and Run history, with "Last 30 days" and no period picker.cd web && npx vitest run src/lib/chat/agent-impact.test.ts src/components/chat/agents src/components/reports src/lib/help.Checklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)help/(or no user-visible change) — see help/README.mdChecks were run locally on 57a153b, which merges
upstream/main5a8de56 (#2134, #2135, #2136, #2137). The branch still merges cleanly into the currentmain.yarn format:checkpasses, andyarn formatchanged nothing.yarn lint: 0 errors, and 7 warnings in files this PR doesn't touch.yarn typecheckpasses.yarn test: 990 files, 10,620 tests passed, 1 skipped.yarn buildpasses with CI's placeholder env.This PR doesn't touch the server,
supabase/orskills/, so those checks weren't run.Open questions
ship.jswritesautomatedwhendelivery.sent_byis null. If the person who clicked a card in the run's chat is removed before the CMS confirms the publish, the change would show "on its own" here. It's rare, and the fix belongs server-side in feat(impact-ledger): credit a page a person approved in an agent run to that run (00480) #2137's code.Generated by Claude Code