Skip to content

Create goals, report progress and find ideas from the conversation - #91

Draft
jerelvelarde wants to merge 1 commit into
mainfrom
jerel/chat-goal-idea-cards
Draft

jerelvelarde wants to merge 1 commit into
mainfrom
jerel/chat-goal-idea-cards

Conversation

@jerelvelarde

Copy link
Copy Markdown
Collaborator

Create, track and find ideas for goals in chat

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: refreshIdeas already 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 new update_goal, and watch_page now render the real GoalCard and MonitorCard inline, and the new find_ideas renders IdeaCards. 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_goal goes through the Goals tab path. The new AgentService.updateGoalProgress is a narrow front end to the existing updateGoal: it takes milestone ids with a done flag, new milestone titles, and an optional status, then calls updateGoal, 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_ideas finds; the person decides. It calls refreshIdeas and 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/:id route 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 has delegate_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_goal and find_ideas. The sample (no model) backend now answers idea requests with the same find_ideas result and card, since idea discovery needs no model; its single hard-coded delegate_task emission was generalised to emit any one tool call.

What is not covered

  • The sample backend does not parse goals or progress from free text. "I want to run a 10K" still becomes a saved agent task waiting for a model, as before. Parsing titles and milestones without a model would be guesswork.
  • "View goal" and "View tracking" open the Goals tab, not the specific goal's sheet; the tab has no deep-link state today.
  • A goal or watch deleted after the chat turn falls back to the plain "Goal" / "Tracking" card.
  • Goal progress is still a read-then-write (updateGoal is 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.
  • Checked on web only. iOS and Android layouts reuse the same components already shown in sheets, but were not run.

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:server and pnpm build:web: succeed.
  • tests/goal-idea-tools.test.ts drives the real ConversationAgent and 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_ideas returns open sample ideas and creates no tasks; the sample backend answers "ideas" through the same result.
  • The recording above is this branch running in sample mode with a scripted model; the API executed every tool. It ends on the Goals tab showing the progress reported in chat.
Progress in chat Ideas Tracking
goal ideas tracking

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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant