Skip to content

fix(web): park conversation-id wire-field cutover above current daemon (0.8.6)#32146

Merged
dvargasfuertes merged 1 commit into
mainfrom
apollo/bump-conv-id-wire-gate-0-8-6
May 26, 2026
Merged

fix(web): park conversation-id wire-field cutover above current daemon (0.8.6)#32146
dvargasfuertes merged 1 commit into
mainfrom
apollo/bump-conv-id-wire-gate-0-8-6

Conversation

@vellum-apollo-bot
Copy link
Copy Markdown
Contributor

Symptom

On staging (release/v0.8.5), the first message of any new conversation 404s.

Root cause

PR #31944 ("feat(web): version-gated cutover to conversationId on POST /v1/messages + GET /v1/events") flipped the wire-field gate at MIN_VERSION = 0.8.5. Two things collide:

  1. The web UI mints a draft conversation UUID locally (createDraftConversationId()chat-layout.handleStartNewConversation) and uses it as the URL key before the daemon has ever heard of it.
  2. The daemon's conversationId handler is strict-lookup (getConversation(id) → 404 on miss). conversationKey is the create-or-lookup path that materializes the row on first use.

On a 0.8.5 daemon, pickConversationIdWireField() returns "conversationId", so the very first POST /v1/messages of a new conversation sends an id the daemon has never minted → NotFoundError → 404. The SSE subscribe path (GET /v1/events) has the same shape.

Fix

Bump MIN_VERSION from 0.8.50.8.6. No daemon ships with 0.8.6 yet, so the gate falls through to conversationKey everywhere → first send materializes the row → no 404.

Why this is a stopgap, not the cure

The cleaner architecture is "daemon mints the conversation on the first send; UI navigates to the response's id." That removes the entire backwards-compat module and the family of bugs it papers over. Tracked as a follow-up; doing it without time pressure.

Scope

  • apps/web/src/lib/backwards-compat/conversation-id-wire-field.tsMIN_VERSION 0.8.5 → 0.8.6, docstring updated to describe current state (gate parked above current daemon version).
  • apps/web/src/lib/backwards-compat/conversation-id-wire-field.test.ts — boundary moved to 0.8.6; 0.8.5 now belongs in the "and older" group.
  • apps/web/src/domains/chat/api/post-chat-message.test.ts — three version-boundary tests updated.
  • apps/web/src/domains/chat/api/stream.test.ts — two version-boundary tests updated.
  • apps/web/src/domains/chat/api/messages.ts + stream.ts — comments rewritten to drop the version reference and describe current state.

Verification

  • bun test src/lib/backwards-compat/conversation-id-wire-field.test.ts — 5 pass
  • bun test src/domains/chat/api/post-chat-message.test.ts — 9 pass
  • bun test src/domains/chat/api/stream.test.ts — 26 pass
  • bun run lint — clean
  • bun run typecheck — clean

…n (0.8.6)

Daemon 0.8.5 strict-lookup on conversationId rejects locally-minted draft
conversation ids, 404ing the first message of every new conversation.
Keep the legacy create-or-lookup conversationKey path live until the
draft-id flow moves to daemon-mints-on-first-send.

Boundary tests updated; targeted tests + eslint + tsc clean.
@dvargasfuertes dvargasfuertes merged commit 61a6966 into main May 26, 2026
7 checks passed
@dvargasfuertes dvargasfuertes deleted the apollo/bump-conv-id-wire-gate-0-8-6 branch May 26, 2026 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant