Tracked from the v1.0.13 release notes (PR #268); discovered during the msgid wrap fix (PR #265).
Symptom
packages/app/src/utils/id.ts still uses the legacy identifier encoding (ts*0x1000 + counter into a 48-bit prefix). The same encoding wrapped on 2026-08-14 19:19:55 +08 in the core packages (PR #265 fixed schema/opencode/core generators to raw-48-bit-ms with a monotonic latch). The app-side copy is internally self-consistent (create+timestamp round-trip), so it degrades only lexicographic ordering assumptions — but every behavior-gating comparison in the server is already time.created-based, so the residual risk is display-only ordering plus generator drift between app and core.
Fix direction
- Migrate the app-side generator to the shared fixed implementation (
@opencode-ai/schema/identifier or a re-export), preserving the app package's public API shape.
- Check the desktop/e2e surfaces for persisted ids that decode with the old scheme (
timestamp() callers) and confirm no live consumer depends on the old arithmetic.
- Add the wrap-boundary + latch tests mirroring
packages/schema/test/identifier.test.ts (7 tests) at the app boundary, or point app tests at the shared suite.
Acceptance
- No
0x1000 arithmetic remains under packages/app (rg '0x1000' packages/app clean).
- App ids sort consistently with core ids for the same wall-clock time (spot-check by prefix).
- Typecheck + app/desktop test gates green; no snapshot churn beyond id-format updates.
Tracked from the v1.0.13 release notes (PR #268); discovered during the msgid wrap fix (PR #265).
Symptom
packages/app/src/utils/id.tsstill uses the legacy identifier encoding (ts*0x1000 + counterinto a 48-bit prefix). The same encoding wrapped on 2026-08-14 19:19:55 +08 in the core packages (PR #265 fixed schema/opencode/core generators to raw-48-bit-ms with a monotonic latch). The app-side copy is internally self-consistent (create+timestamp round-trip), so it degrades only lexicographic ordering assumptions — but every behavior-gating comparison in the server is already time.created-based, so the residual risk is display-only ordering plus generator drift between app and core.Fix direction
@opencode-ai/schema/identifieror a re-export), preserving the app package's public API shape.timestamp()callers) and confirm no live consumer depends on the old arithmetic.packages/schema/test/identifier.test.ts(7 tests) at the app boundary, or point app tests at the shared suite.Acceptance
0x1000arithmetic remains under packages/app (rg '0x1000' packages/appclean).