Repository navigation
fix(host-runtime): accept official Item anchor cursors in External thread/items/list - #987
Conversation
|
Caution Review failedThe pull request is closed. No actionable comments were generated in the recent review. Summary
Merge Risk:
|
…rsor An object anchor on thread/items/list skipped the history refresh because any non-empty cursor counted as a continuation, so an unloaded Thread reported the anchor as missing.
|
Merged, thanks @ump45nose! One follow-up commit (503f900): an object Item anchor on an unloaded Thread skipped the history refresh (any non-empty cursor counted as a continuation) and reported the anchor as missing; it now loads history first. String continuation cursors are unchanged. Regression test added in app-server-host.projection-2.test.ts. |
Eleven manifest lines still carried fork copies of changes that upstream has already released. Each one names a merged PR whose head commit is an ancestor of v0.28.2, so the line only re-applies the pre-review copy of code that the release tag already contains, and that duplication is what turns the manifest replay into conflicts. Removed lines and their merged PRs: - thin/cursor-fast-selection (BytePioneer-AI#782) - thin/delegation-inspect-fast-models (BytePioneer-AI#986) - thin/delegation-catalog-parent (BytePioneer-AI#970) - thin/settings-hide-desktop-envs (BytePioneer-AI#972) - thin/settle-turns-after-session-fault (BytePioneer-AI#969) - thin/external-thread-turn-recency (BytePioneer-AI#973) - thin/claude-code-todo-tools (BytePioneer-AI#976) - thin/reasoning-summary-parts (BytePioneer-AI#967) - thin/shared-archived-thread-revival (BytePioneer-AI#988) - fix/desktop-mcp-session-reap-v0.22 (BytePioneer-AI#981) - fix/macos-descriptor-mode (BytePioneer-AI#1004) For the two lines whose comments noted that the fork copy predated the PR's review changes (BytePioneer-AI#969, BytePioneer-AI#976), the reviewed upstream version replaces it. Checked with `scripts/vincent-release.sh audit` (ancestor and patch-cherry checks) and by replaying the manifest onto v0.28.2 in a scratch worktree: these eleven lines no longer merge, and the fifteen remaining lines are fork-only changes that need re-cutting from the new tag. Lines for fork-only additions are untouched: the extras documented for BytePioneer-AI#470, BytePioneer-AI#987 and BytePioneer-AI#989 stay, and the lines for the closed PRs BytePioneer-AI#576, BytePioneer-AI#783, BytePioneer-AI#784, BytePioneer-AI#785 and BytePioneer-AI#396 stay.
Purpose
The official app-server protocol lets
thread/items/listtake either an opaque string cursor or an Item anchor,{ "type": "item", "itemId": "…" }. The anchor is an exclusive position inside the requestedturnId: ascending returns Items after it and descending returns Items before it. You can confirm this in the schema thatcodex app-server generate-json-schema --experimentalemits (codex-cli 0.169.1), underThreadItemsListParams.cursor→ThreadItemsListCursor/ThreadItemsListAnchor.For External Threads,
listExternalItemsonly accepts the Host's own string cursor. An Item anchor object is rejected withcursor must be text, so a client that pages Items by anchor gets an error. The fork found this while reopening paginated External Threads in Desktop.Root cause
parseCursorinpackages/host-runtime/src/external-thread-history.tsrequires text and only understands{anchor, includeAnchor}JSON.Change
listExternalItemsresolves an Item anchor to the existing internal anchor[turnId, itemId]withincludeAnchor: false, then pages as before. An anchor withoutturnIdis rejected. So is a malformed anchor. An anchor that is not in the requested Turn gets the existingcursor anchor is no longer present.thread/turns/listis unchanged, because its official cursor is string-only.Validation
npx tsc -bnpx vitest run -c tests/vitest.config.js packages/host-runtime/test/external-thread-history.test.ts: the 3 new cases fail onmainand pass with this change (20/20).Known baseline on main (unchanged by this PR)
packages/adapters/antigravity/test/acp-transport.test.ts:457-458andapp-server-host.background-output.test.ts:146