Repository navigation
feat(chat): e-mail a person once when their agent's run waits for them, by "Notify me when an agent needs me" (00474) - #2086
Merged
gkhngyk merged 4 commits intoNov 4, 2026
Conversation
…m, by "Notify me when an agent needs me" (00474) Co-Authored-By: Claude Opus 5.5 <[email protected]>
Merged
8 of 13 tasks
gkhngyk
previously approved these changes
Nov 3, 2026
Contributor
|
Conflicts with main. Please merge main in. |
…needs-me-email # Conflicts: # web/src/lib/chat/agent-driver.ts
Collaborator
Author
|
Merged main (d796cc7): the agent driver keeps the needs-you imports beside main's openHeadlessRun. |
Contributor
|
Conflicts again after #2090 merged (chat settings / help). Please merge main in. |
gkhngyk
previously approved these changes
Nov 4, 2026
8 of 13 tasks
…needs-me-email # Conflicts: # help/chat/chat-settings.md # web/src/components/chat/chat-settings.test.tsx # web/src/components/chat/chat-settings.tsx # web/src/lib/help/approved-articles.json
cihan-gyk
pushed a commit
to cihan-gyk/ansvisor
that referenced
this pull request
Nov 4, 2026
00474 is also taken by ansvisor#2086's 00474_chat_notices_agent_needs_you.sql. 00478 is free on main and on every open branch. schema.sql rebuilt with build-schema.sh; nothing else names the number. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SvzkMenyNyxsr2Doq4CaQ3
…needs-me-email # Conflicts: # supabase/schema.sql
6 of 13 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.
Summary
"Notify me when an agent needs me" in Settings › Chat works now. It was hidden in #1903 because nothing read it.
When one of a person's agents stops to ask them something, or to wait for their OK on a change (the agent run's status becomes
needs_you), they get:How it works:
settleAgentRuninagent-driver.ts): when a run moves toneeds_you, it calls the API server's newPOST /api/internal/chat/notices/needs-you(CRON_SECRET;agent-needs-you.ts). When the run moves on or ends, the run's notice closes (resolved_at). Neither step throws or holds the run.lib/chat-notices/needs-you.js, the pattern ofgo-live.js, whose helpers it now exports):acting_user_id, else the agent's owner), when they are a member and reach the run's brand;chat_noticesrow of the new kindagent_needs_you, dedupeagent_needs_you:{run id}, so a run that waits again sends no second email;chat_user_prefs.notify_via, like the other agent notices.noticeOfleavesagent_needs_youout.help/chat/chat-settings.mdgets a "Notify me when an agent needs me" section. The article is approved, soapproved-articles.jsonis regenerated.Migration 00474 (
00474_chat_notices_agent_needs_you.sql) rewriteschat_notices_kind_checkto addagent_needs_you. The full kind list:own_key_failed,own_key_limit_80,own_key_limit_100,agent_went_live,agent_go_live_off,schedule_failed,schedule_paused,followup_result,agent_needs_you.It keeps 00446's kinds and 00461's: 00461 is W3-04a's notices for scheduled jobs, in an open pull request. If another open migration also rewrites
chat_notices_kind_check, the later one must list every kind, or the other's notices are refused.schema.test.tschecks the list.If one of the other two Chat settings pull requests ("Answer language", "Thought for N s") merged first,
chat-settings.tsx, its test and the Help article conflict on the hidden-settings comment and the sections. Keep every row and section, then runcd web && yarn vitest run -u src/lib/helpto regenerateapproved-articles.json.Related issue
None. User priority list, item 3 (the three hidden Chat settings).
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
cd server && npx vitest run src/lib/chat-notices/needs-you.test.js src/routes/internal-chat-notices.test.js. Covered:cd web && yarn vitest run src/lib/chat/agent-driver.test.ts src/lib/chat/agent-needs-you.test.ts src/lib/chat/notices.test.ts src/components/chat/chat-settings.test.tsx src/lib/chat/schema.test.ts.Needs migration on prod: 00474, after 00473.
No new environment variables (CRON_SECRET and Resend's exist).
Checklist
yarn lintpassesyarn typecheckpassesyarn format:checkpasseshelp/(or no user-visible change)CI passed on this branch (95fd81d), run on the fork (https://github.com/cihan-gyk/ansvisor/actions/runs/41634857951): schema is up to date; web
format:check, lint, typecheck, all tests andyarn buildpass; server lint,format:checkand all tests pass.🤖 Generated with Claude Code