goal: session started with /goal gets a truncated objective as its title, not a generated title

未关闭 适合新手
#68,298 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
72/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
typescript

调研方向

阅读 packages/core/src/plugin/goal.ts 第411–418行附近的代码,了解 goal 插件在何处将截断后的目标指定为会话标题。追踪普通的首条用户提示如何触发 SessionTitle.generate,并将其与合成的 goal 启动流程进行比较。更新标题处理逻辑,使首次 /goal 会话获得生成的摘要标题。然后验证侧边栏或页眉不再显示截断后的目标。

由索引模型根据 Issue 内容生成。

描述

area/plugins platform/windows type/feature version/v2

Summary

Starting a new session with /goal <objective> as the first input gives the session a literal quote of the objective (truncated to 60 characters) instead of a generated title. Because the goal kickoff is stored as a synthetic message rather than a user message, the title agent never names the session.

Environment

  • opencode version: 2.4.4
  • Client: Desktop
  • Model and provider: ollama-cloud/deepseek-v4.1-flash
  • OS: Windows 10.0.19045 (win32 x64)
  • Terminal: Not relevant (Desktop)
  • Shell: Not relevant (Desktop)
  • Install/channel: latest
  • Active plugins: none found (MCP server ollama-web-search configured)

Reproduction

  1. Open OpenCode Desktop and create a new session.
  2. As the very first input, run /goal <objective> with any objective, e.g. /goal Ship the release and update the changelog.
  3. Let the goal kickoff start and look at the session title in the sidebar/header.

Expected Behavior

The session should receive the same short, model-generated summary title it would receive from a normal first user prompt.

Actual Behavior

The title is a literal quote of the /goal objective, truncated to 60 characters with … for longer objectives. It is never regenerated, even after the goal has been running.

Additional Context

Root cause is in packages/core/src/plugin/goal.ts:411-418: when the session still has the root fallback title, the goal plugin explicitly sets title: truncate(text, 60), with the comment that titles come from the first user message and the notice kickoff is not one. Since the kickoff is synthetic, SessionTitle.generate never produces a title from a user message for that session.

Frequency: deterministic; always happens when /goal is the first input.

Related: #61332 mentions the same title side effect while reporting that the goal objective is missing from the timeline; this issue tracks the title behavior itself.

Workaround: rename the session manually, or send a normal message before running /goal.

主要语言
TypeScript
星标
230k
派生
31.3k
平均合并
5 小时 44 分钟
30 天内合并 PR
529

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

anomalyco/opencode 的其他 Issue

查看 anomalyco/opencode 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。