Skip to content

DeepSeek Harness incremental imports must keep a session-scoped title #524

Description

@hawkingrei

Summary

DeepSeek Harness incremental thread imports derive the thread title from each delta batch. The same stable thread can therefore receive a different --title on every import, and the reconciliation retry can submit a payload whose title does not match the already-built CLI arguments.

Current behavior

buildThreadImportDelta derives payload.title from the delta message list. importSession then captures that title once in baseImportArgs.

Consequences:

  • A later delta whose first user message differs can rename the same stable thread.
  • After an optimistic append conflict, the full reconciliation payload replaces payload, but baseImportArgs retains the earlier delta title.

Expected behavior

  • Thread identity and title remain session-scoped across incremental batches.
  • A reconciliation import builds arguments from the reconciliation payload rather than stale delta metadata.
  • Exact replay and optimistic append behavior remain unchanged.

Reproduction

  1. Build a DSH session with at least two user turns that have different text.
  2. Import the first batch and retain its acknowledged cursor.
  3. Import the second batch using that cursor.
  4. Observe that the second delta derives its title from the later batch rather than the session's first user message.
  5. Force an expected-message-count conflict and observe that the reconciliation payload is rewritten while the original baseImportArgs title is reused.

Environment

Acceptance criteria

  • Incremental batches use one stable session-scoped title.
  • Reconciliation rebuilds CLI arguments from the reconciliation payload.
  • Regression tests cover two deltas with different first messages.
  • Regression tests cover conflict-to-full-reconciliation argument rebuilding.

Discovery

Found while reviewing PR #513. Kept separate because the affected code is already on main and is not part of that PR's final diff.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions