Skip to content

goal: the initial objective disappears from the timeline after /goal #61332

Open

Description

@magiccodelab

Description

When /goal <objective> is used in a session, the objective never appears as a user message. The first timeline row is a synthetic kickoff notice rendered as one truncated line:

Goal: 参见计划:...

The rest of the objective cannot be read or expanded from the transcript. This makes the user's initial request look like it disappeared, especially in long sessions.

Steps to reproduce

  1. Start a new session.
  2. Run /goal <objective> with an objective longer than one line.
  3. Look at the top of the timeline.
  4. Try to expand the Goal: ... row or find the rest of the text.

Expected

The objective should remain readable in the session, for example as a collapsible goal card or an expandable notice with the full text. Copying it should also be possible.

Actual

Only Goal: <first 120 characters> is shown, then the row is clipped by truncate. The full text exists in the synthetic message's text field, but there is no UI path to it. The session title is also replaced with the first 60 characters of the objective, so the tab and header show the same fragment.

Root cause

  • packages/core/src/plugin/goal.ts:411-431 stores the objective in goal storage and creates a synthetic kickoff with description: Goal: ${truncate(text, 120)} instead of a user message.
  • packages/session-ui/src/timeline/projection.ts:1179-1186 projects synthetic messages with a description as Notice rows.
  • packages/session-ui/src/timeline/session-timeline-row.tsx:574,727-729 renders the notice as a single-line truncate with no expand or copy.
  • packages/core/src/plugin/goal.ts:404-409 overwrites the session title with truncate(text, 60).

Additional context

  • A real 356-message session export has messages[0].type === "synthetic", metadata.source === "goal", and only one later user message. The initial objective is not present as a user message.
  • This is the built-in goal plugin added in feat(core): add /goal with a client-side done check #59437 (v2.2.1+), not a third-party plugin.
  • The goal pill also lacks a full-text or copy view; this is tracked separately.

Environment

  • OpenCode Desktop v2.2.5 (source checkout 1bf08ae; Desktop and web share the same packages/app renderer).
  • Windows desktop app.
  • No third-party plugins; this is the built-in goal plugin.

Activity

  1. opencodejr commented on Nov 3, 2026

    @opencodejr

    Thanks for the detailed write-up! You're asking for the full /goal objective to stay readable in the session: for example, an expandable or copyable goal notice (or a goal card) instead of the single truncated Goal: … row.

    This is how it currently works by design. The goal plugin sends the kickoff as a synthetic message and shows a short one-line notice so the whole kickoff prompt doesn't fill the timeline. The session title is set from the objective because that notice isn't a user message the title could come from. The full text is still stored in the message, as you found, but there's no way to view it in the UI yet, so I've filed this as a feature request. Maintainers will consider it.

    Related:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions