跳转到内容

会话便签

会话便签让你为单次对话设定持久目标。每轮结束后,独立的 judge model(评判模型) 判定目标是否完成;若未完成,则自动注入续写提示,直至目标达成、轮次预算耗尽,或用户暂停/清除。

命令说明
/goal <description>设定目标并启动首次运行(默认 20 轮预算)
/goal status查看目标、子目标、轮次计数、评判理由
/goal pause暂停自动续写(保留目标状态)
/goal resume恢复自动续写
/goal clear清除目标
/subgoal列出子目标
/subgoal <condition>追加子条件
/subgoal remove <N>移除第 N 个子目标(从 1 起计)
/subgoal clear清除全部子目标

On Chat, terminal commands (/goal status, pause/resume/clear, /subgoal list, etc.) run via Habitat RPC conversation.command and show in a result panel or toast — they do not flash through the message stream. Setting a goal (/goal <description>) and /retry still use message.send so the LLM turn streams into the conversation. Discord/Weixin keep the existing slash → stream reply path.

  1. 用户执行 /goal … → 写入 conversations.goal 并触发 engine 运行。
  2. 每次助手回复后 → goal judge(目标评判) 读取目标、子目标、近期对话与上次回复。
  3. 评判输出严格 JSON:{"done": boolean, "reason": "..."}
  4. done: false → 注入 user 角色续写(如 ↻ Continuing toward goal (3/20): …),在同一 SSE 流中继续下一轮。
  5. done: true → 标记完成,停止续写。
  6. 运行中用户消息会抢占当前续写;该轮结束后重新评判;未暂停则继续。
  • 通过:助手明确确认完成、展示最终交付物,或说明需用户输入的阻塞(理由中说明)。
  • 不通过:进展模糊、仅有计划而无证据;隐含完成不算。
  • Judge unavailable: call or parse failure pauses the goal (status: paused), logs a warn, and appends a visible status line to the conversation (not a continue prompt). Use /goal resume to retry. Check /goal status for last_judge_reason.

Optional goal_judge in Habitat runtime llm.profiles (Shell Settings → Habitat 服务 → 服务配置). Falls back to llm.default_profile when unset.

Judge calls use OpenAI-compatible response_format: json_object and thinking: { type: "disabled" } (via params.extra), plus maxOutputTokens: 2048. Prefer a model/gateway that supports JSON mode; unsupported endpoints will fail the judge call and pause the goal.

  • Goal:对话内同步续写循环;由平台轮次生命周期编排。
  • ACP:外部 agent 异步任务;回调在完成后触发独立轮次。

See architecture.md.