Repository navigation
feat(agent): goals run in the background and call the person only when needed - #339
Merged
Merged
Conversation
…n needed A goal is a conversation of its own, of the kind goal, with a title, a one-line status, an activity log and the things it made (migration 0148). Its turns run there, may start background work, and record mail rules, reminders and alert mutes they make. When a goal comes to need the person, the worker's sweep says so once in the main conversation; the main turn's prompt lists waiting goals, and the goal tool's tell passes the answer on. ListAgentGoals, GetAgentGoal, StartAgentGoal, TellAgentGoal and SetAgentGoalState back the tool and 'teanode agent goal'. Goals are no longer put on conversations the person chats in.
…ts log Needs you, Tracking and Done, each goal with its status line; a goal's page shows what it is for, what it made and what happened, with a box to answer it and Done, Drop and Reopen. The drawer draws a goal's call for the person with a link to it, and its goal menu starts a goal in the background.
…eir own send no mail Found running goals on a dev server: the model passed its status as status, not text, so the goal tool takes status for note and wait; the drawer hid the goal's call with the working notes; and the mail a waiting goal sent was itself alerted on, saying the same thing twice.
The leftover set action could only clear a goal left on a conversation from before, but a model asked to set a goal reached for it. The idea that offers goals now sees goals of their own as tried.
One kind of goal is left, the background goal. The drawer's goal menu on a chat, the goal arguments of StartAgentConversation and UpdateAgentConversation, the in-progress listing, the turn count, the goal-change lines in transcripts and the goal tool's set are gone; only goal conversations take turns. The tool's guidance says a hope is not a goal to start.
…ere it was asked A goal whose work is on a clock takes no turns of its own while it has an enabled schedule; the schedule's runs are its turns, in its conversation, ending with the goal tool. Schedules become a goal's when made in it, passed to start, or moved with take_schedule (MoveAgentScheduleToGoal, teanode agent goal take-schedule). A goal whose schedule is switched off gets a turn again. The goal remembers the conversation it was asked in (migration 0149) and its page links it; the agent is told to write goal text without ids. The activity timeline's dots and line now line up, and long text wraps.
A done or dropped goal's schedule no longer runs, and a goal's own turn cannot reopen a goal that is done. A mailed schedule is no goal's clock, and a schedule made or edited in a goal's conversation answers there. An answer to a goal on a schedule earns a turn at once, and a goal on a schedule takes no forced second turn. Only the person moves a schedule into a goal. The goal operations run in the request's transaction, so a start that fails leaves no goal behind; saying a waiting goal is checked under the row's lock. The goal tool answers with goalState and goalStatus.
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.
A goal is now background work: it runs in a conversation of its own, keeps an activity log and the things it made, and writes into the main conversation only when it needs the person. Design:
docs/planning/background-goals-execplan.md; decision:docs/decisions/20261005-goals-run-in-the-background-and-call-only-when-needed.md.goal_titleandgoal_surfaced_aton conversations,agent_goal_activity,agent_goal_artifact; conversations of the kindgoal.surfaceGoalswrites a waiting goal into the main conversation once, under[goal needs you]; the main prompt lists waiting goals, and the goal tool'stellpasses the answer on. Goals of their own send no mail.ListAgentGoals,GetAgentGoal,StartAgentGoal,TellAgentGoal,SetAgentGoalState; the goal tool andteanode agent goal list|show|start|tell|done|drop|reopenuse them. The per-conversation goal is removed: no goal menu on a chat, no goal arguments on conversations, nosetin the tool.Test plan: Go tests for starting, running out of the main conversation, surfacing once, telling, dropping and reopening, and the API's permissions; web tests for the tab and a goal's page;
make lint-ci. On a dev server with a real model, a goal asked a question, was answered in the main chat and was met; checked in a browser at 1400 and 390 pixels, light and dark.Changelog
Added
teanode agent goallists, starts, answers and closes them.Removed