Skip to content

fix(workspace-mode): accept legacy "direct" alias for Local#8

Merged
shaoweihu merged 1 commit into
Pyiner:mainfrom
Binlogo:fix/workspace-mode-direct-alias
May 21, 2026
Merged

fix(workspace-mode): accept legacy "direct" alias for Local#8
shaoweihu merged 1 commit into
Pyiner:mainfrom
Binlogo:fix/workspace-mode-direct-alias

Conversation

@Binlogo
Copy link
Copy Markdown
Collaborator

@Binlogo Binlogo commented May 21, 2026

Summary

  • After c10450a renamed WorkspaceMode::DirectLocal (serde value "direct""local"), any client or persisted state still emitting "direct" makes POST /api/threads fail with unknown variant 'direct'.
  • The desktop UI surfaces this as Error invoking remote method 'garyx:create-thread': Failed to deserialize JSON body — workspaceMode: unknown variant 'direct' when creating a new thread.
  • Add #[serde(alias = "direct")] on WorkspaceMode::Local so legacy payloads keep deserializing while the rename rolls out everywhere.

Test plan

  • cargo test -p garyx-router workspace_mode — extended workspace_mode_serializes_public_local_name to assert "direct" still parses as Local.
  • cargo test -p garyx-router -p garyx-gateway — full suites pass (193 router tests, 0 failures).

Old clients and any persisted state from before the Direct→Local rename
still send `workspaceMode: "direct"`, which breaks `POST /api/threads`
deserialization with `unknown variant 'direct'`. Add a serde alias so the
gateway keeps accepting the old value while clients catch up.
@shaoweihu shaoweihu merged commit 39c83bb into Pyiner:main May 21, 2026
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.

2 participants