fix(cli): include __start__ message in nerve thread show #232

Merged
xiaomo merged 1 commits from fix/231-thread-show-start-message into main 2026-04-28 15:36:33 +00:00
Owner

What

When nerve thread show is called without --before, the initial user prompt (__start__ message) is now displayed first, followed by the most recent role rounds within the budget.

Why

Workflow roles (planner, coder, etc.) that read the thread via nerve thread show could not see the original user prompt — they only saw outputs from previous roles. This caused planner to miss critical user requirements.

Changes

  • packages/store/src/log-store.ts — add getThreadStartMessage(runId) method
  • packages/cli/src/commands/workflow.ts — modify buildThreadCommandOutput to accept optional startRow
  • packages/cli/src/commands/thread.ts — pass start message when before===0
  • Tests added for new behavior, daemon mocks updated

Fixes #231

## What When `nerve thread show` is called without `--before`, the initial user prompt (`__start__` message) is now displayed first, followed by the most recent role rounds within the budget. ## Why Workflow roles (planner, coder, etc.) that read the thread via `nerve thread show` could not see the original user prompt — they only saw outputs from previous roles. This caused planner to miss critical user requirements. ## Changes - `packages/store/src/log-store.ts` — add `getThreadStartMessage(runId)` method - `packages/cli/src/commands/workflow.ts` — modify `buildThreadCommandOutput` to accept optional `startRow` - `packages/cli/src/commands/thread.ts` — pass start message when `before===0` - Tests added for new behavior, daemon mocks updated Fixes #231
xiaoju added 1 commit 2026-04-28 15:09:48 +00:00
When 'nerve thread show' is called without --before, the initial user
prompt (__start__ message) is now displayed first, followed by the most
recent role rounds within the budget.

- Add getThreadStartMessage() to LogStore
- Modify buildThreadCommandOutput to accept optional startRow
- Pass start message from threadShowCommand when before===0
- Add tests for new behavior

Fixes #231
xiaomo approved these changes 2026-04-28 15:36:31 +00:00
xiaomo left a comment
Owner

LGTM

Store 层 getThreadStartMessage() 实现干净:

  • 单独 SQL prepared statement,精确匹配 role='__start__'
  • 返回 round: 0,不影响 getThreadRoundCount/getThreadRounds 的编号
  • CLI 层只在 before===0(第一页)时注入,后续分页不重复

测试覆盖全面(存在/不存在 start message、budget 消耗、排序验证)。daemon mock 同步更新。

附带注意到 index.ts 新增了 cursorAgentllmExtract 的 re-export — 这是扩大了 public API,应该是后续 workflow 需要直接用,没问题。

LGTM ✅ Store 层 `getThreadStartMessage()` 实现干净: - 单独 SQL prepared statement,精确匹配 `role='__start__'` - 返回 `round: 0`,不影响 `getThreadRoundCount`/`getThreadRounds` 的编号 - CLI 层只在 `before===0`(第一页)时注入,后续分页不重复 测试覆盖全面(存在/不存在 start message、budget 消耗、排序验证)。daemon mock 同步更新。 附带注意到 `index.ts` 新增了 `cursorAgent` 和 `llmExtract` 的 re-export — 这是扩大了 public API,应该是后续 workflow 需要直接用,没问题。
xiaomo merged commit 7afed2aa0d into main 2026-04-28 15:36:33 +00:00
This repo is archived. You cannot comment on pull requests.
No Reviewers
No Label
2 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/nerve#232