Skip to content

Add API version negotiation to detect frontend/server mismatch#108

Draft
yzx9 wants to merge 1 commit into
mainfrom
issue-68-api-version
Draft

Add API version negotiation to detect frontend/server mismatch#108
yzx9 wants to merge 1 commit into
mainfrom
issue-68-api-version

Conversation

@yzx9

@yzx9 yzx9 commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

The publicly-deployed copilotj.chat frontend can point at user self-hosted servers. Add a MAJOR.MINOR protocol version so the frontend can detect an incompatible (typically too-old) server instead of silently breaking.

Backend:

  • copilotj/server/protocol.py: API_VERSION_MAJOR/MINOR integers combined into API_VERSION = "1.0" (bump MAJOR on breaking protocol changes, MINOR on backward-compatible additions).
  • server.py: add GET /api/version -> {"api_version": ...}; /api/ping is unchanged.

Frontend:

  • web/src/apis/version.ts: API_VERSION constant, getServerVersion(), and isApiVersionCompatible() (compatible when MAJOR matches).
  • store/state.ts: apiVersionStatus (compatible/incompatible/unknown) and a checkApiVersion() action.
  • SettingsConnection.vue (wizard Step 1): inline version status after a successful connect; non-blocking.
  • ChatboxHello.vue: dismissible version banner for returning users.
  • Chat.vue: run checkApiVersion() on load and after the wizard completes.

The backend protocol.py and frontend version.ts constants must be kept in sync by hand (called out in both docstrings).

close: #68

@yzx9 yzx9 changed the title Add API version negotiation to detect frontend/server mismatch (#68) Add API version negotiation to detect frontend/server mismatch Jun 19, 2026
The publicly-deployed copilotj.chat frontend can point at user self-hosted
servers. Add a MAJOR.MINOR protocol version so the frontend can detect an
incompatible (typically too-old) server instead of silently breaking.

Backend:
- copilotj/server/protocol.py: API_VERSION_MAJOR/MINOR integers combined
  into API_VERSION = "1.0" (bump MAJOR on breaking protocol changes, MINOR
  on backward-compatible additions).
- server.py: add GET /api/version -> {"api_version": ...}; /api/ping is
  unchanged.

Frontend:
- web/src/apis/version.ts: API_VERSION constant, getServerVersion(), and
  isApiVersionCompatible() (compatible when MAJOR matches).
- store/state.ts: apiVersionStatus (compatible/incompatible/unknown) and a
  checkApiVersion() action.
- SettingsConnection.vue (wizard Step 1): inline version status after a
  successful connect; non-blocking.
- ChatboxHello.vue: dismissible version banner for returning users.
- Chat.vue: run checkApiVersion() on load and after the wizard completes.

The backend protocol.py and frontend version.ts constants must be kept in
sync by hand (called out in both docstrings).
@yzx9 yzx9 force-pushed the issue-68-api-version branch from 5c010fa to 82873d3 Compare June 19, 2026 11:18
@yzx9 yzx9 closed this Jun 20, 2026
@yzx9 yzx9 reopened this Jun 20, 2026
@yzx9 yzx9 added the enhancement New feature or request label Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The long-term compatibility issues of copilotj.chat

1 participant