Create goals, report progress and find ideas from the conversation - #91
Draft
jerelvelarde wants to merge 1 commit into
Draft
jerelvelarde wants to merge 1 commit into
jerelvelarde wants to merge 1 commit into
Conversation
Chat now renders the saved goal, page watch and idea suggestions inline, reading each record live from the agent workspace. New update_goal and find_ideas chat tools reuse the Goals tab update path and refreshIdeas; starting or dismissing an idea still happens from its card.
This branch has not been deployed
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.
The problem
A person can tell OpenMuse "I want to run a 10K this fall" and the agent will save a goal, but the conversation only shows a placeholder: "Goal", "Open the workspace to see the saved result.", and a button. The goal itself, its milestones and the actions that move it forward live on the Goals tab. The same is true of a page watch. The chat is where the request was made, yet it is the one place the result cannot be seen.
Tracking is worse. There is no chat tool that changes a goal, so "I ran my first 5K" or "pause my 10K goal" cannot be recorded in the conversation at all; the person has to leave chat, find the goal and tick the box themselves. Ideas have the same gap in the other direction:
refreshIdeasalready finds documents to fill in, meetings to coordinate and goals without a plan, but only the Ideas tab can ask for them. "Any ideas for me?" in chat becomes a generic delegated task.The approach
Cards read the saved record, not the tool result.
create_goal, the newupdate_goal, andwatch_pagenow render the realGoalCardandMonitorCardinline, and the newfind_ideasrendersIdeaCards. Each tool result is treated only as a pointer: the card looks the record up by id in the polled agent workspace. That keeps every card live. Ticking a milestone in chat, on the Goals tab, or reporting it in a later message moves the count everywhere, including on earlier cards in the transcript. The cost is that an earlier card shows current state rather than the state at that moment in the conversation; for goals that is the useful answer, and the assistant's own text records what changed.update_goalgoes through the Goals tab path. The newAgentService.updateGoalProgressis a narrow front end to the existingupdateGoal: it takes milestone ids with a done flag, new milestone titles, and an optional status, then callsupdateGoal, so pausing a goal still pauses its running tasks. It is narrower than the HTTP patch on purpose. The route accepts a whole replacement milestone array, which is right for a UI holding the full list and wrong for a model that might drop or rename items; here a model can only flip milestones it names, and an id that is not on the goal is an error rather than a silent no-op. Ownership is unchanged because every read is owner-scoped: another owner's goal id is "Goal not found". Milestones added in chat derive their ids from the request key, so a replayed tool call cannot add the same milestone twice. Errors come back as{ error }so the card and the model both report them honestly.find_ideasfinds; the person decides. It callsrefreshIdeasand returns up to five open ideas (id, title, reason, kind, plus a count of the rest), without the evidence excerpts, which the card reads from the workspace. There is deliberately no chat tool to accept or dismiss an idea. Accepting creates a goal and a task from text derived from source mail, so it stays a native action on the card, like approvals; "Start this", "Edit" and "Dismiss" call the same/ideas/:idroute as the Ideas tab, and starting one opens the task exactly as it does there. If the person asks in words to start something, the model already hasdelegate_task. Accepted and dismissed ideas stay in the chat card as "Started" with a "View task" link, or "Dismissed".The system prompt gains one sentence telling the model when to call
update_goalandfind_ideas. The sample (no model) backend now answers idea requests with the samefind_ideasresult and card, since idea discovery needs no model; its single hard-codeddelegate_taskemission was generalised to emit any one tool call.What is not covered
updateGoalis not compare-and-swap), so a chat update and a simultaneous tap on the Goals tab can race. That is existing behaviour of the route, unchanged here.Verification
pnpm lint: clean (123 files).pnpm typecheck: clean (server and mobile).pnpm test: 210 of 210 passed, run twice (206 before this branch).pnpm build:serverandpnpm build:web: succeed.tests/goal-idea-tools.test.tsdrives the realConversationAgentand SDK against a scripted model: create a goal, record milestone progress and a new milestone, replay the same call without duplicating it, and pause; reject another owner's goal, an unknown milestone id and an empty update while leaving the goal unchanged;find_ideasreturns open sample ideas and creates no tasks; the sample backend answers "ideas" through the same result.