Skip to content
This repository was archived by the owner on Sep 7, 2026. It is now read-only.

refactor(client): remove dead ApiKeysClient and SessionClient (keys + accept_tos) - #225

Merged
VascoSch92 merged 3 commits into
mainfrom
vasco/remove-apikeys-tos-clients
Jun 23, 2026
Merged

VascoSch92 merged 3 commits into
mainfrom
vasco/remove-apikeys-tos-clients

Conversation

@VascoSch92

@VascoSch92 VascoSch92 commented Jun 23, 2026 •

Copy link
Copy Markdown
Member

Human

@neubig you added these end-points but it seems that neither the agent-server exposes nor agent-canvas consumes.

Can we delete them or you plan to use them?

What

Removes two more client surfaces for endpoints that no consumer reaches through this package — absent from the agent-server on every branch, and unused by agent-canvas. Follow-up to #224.

Removed Endpoint(s) Notes
ApiKeysClient (whole class) + ConversationManager.apiKeys GET /api/keys, POST /api/keys, DELETE /api/keys/{}
SessionClient (whole class) + ConversationManager.session POST /api/accept_tos acceptTos was its only remaining method after #224 removed unsetProviderTokens, so the now-empty class is dropped entirely rather than left as a no-op.

Also drops the orphaned types ApiKey, CreateApiKeyResponse, AcceptTosResponse and the ApiKeysClientOptions / SessionClientOptions exports.

Where these endpoints actually live

They are served by the OpenHands/OpenHands enterprise/ server (the SaaS backend) and consumed by its own frontend via its own axios client — not @openhands/typescript-client:

  • enterprise/server/routes/api_keys.py (APIRouter(prefix='/api/keys'))
  • enterprise/server/routes/auth.py (@api_router.post('/accept_tos'))

So removing these client classes does not affect OpenHands/OpenHands, agent-canvas, or the agent-server.

Scope notes

  • SharedClient (GET /api/shared-events/search) is kept — it's actively used by agent-canvas (use-shared-conversation.ts, use-shared-conversation-events.ts).
  • The /api/keys/**current** endpoint that agent-canvas does call is a different route, reached via the cloud-proxy, not via ApiKeysClient — unaffected.

Breaking change

Removes the public ApiKeysClient and SessionClient classes, ConversationManager.apiKeys, ConversationManager.session, and the types ApiKey / CreateApiKeyResponse / AcceptTosResponse.

Verification

  • tsc --noEmit: clean
  • npm run lint: 0 errors (pre-existing no-explicit-any warnings only)
  • npm test: 258/258 pass (14 suites)

… accept_tos)

These client surfaces call SaaS endpoints that no consumer reaches through
this package: they are absent from the agent-server (on every branch) and
unused by agent-canvas. The endpoints themselves are served by the
OpenHands/OpenHands `enterprise/` server and consumed by its own frontend
(its own axios client, not @openhands/typescript-client).

- Remove ApiKeysClient and ConversationManager.apiKeys
  (GET /api/keys, POST /api/keys, DELETE /api/keys/{id}).

- Remove SessionClient and ConversationManager.session. acceptTos
  (POST /api/accept_tos) was its only remaining method after #224 removed
  unsetProviderTokens, so the now-empty class is dropped entirely rather
  than left as a no-op.

Also drops the now-orphaned types ApiKey, CreateApiKeyResponse,
AcceptTosResponse and the ApiKeysClientOptions / SessionClientOptions
exports.

SharedClient (GET /api/shared-events/search) is retained — it is actively
used by agent-canvas.

BREAKING CHANGE: removes the public ApiKeysClient and SessionClient classes,
ConversationManager.apiKeys, ConversationManager.session, and the types
ApiKey / CreateApiKeyResponse / AcceptTosResponse.
@github-actions

Copy link
Copy Markdown
Contributor

Endpoint audit

❌ 8 off-contract call(s) — not on the agent-server · classifiers: cloud

Category Count
❌ Off-contract (not on agent-server) 8
  ⛔ no known backend 7
  ↗️ served by cloud 1
➕ Missing API (agent-server has, client lacks) 9
agent-server endpoints 104
client endpoints 101

❌ Not on agent-server (gated, 8)

⛔ (no known backend) — served by no backend we can see (7)

  • DELETE /api/meta-profiles/{}
  • GET /api/meta-profiles
  • GET /api/meta-profiles/{}
  • POST /api/cloud-proxy
  • POST /api/meta-profiles/{}
  • POST /api/meta-profiles/{}/activate
  • POST /api/skills/installed/{}/update

↗️ served by cloud (1)

  • GET /api/shared-events/search

➕ Missing API — agent-server exposes it, client does not implement (9)

  • GET /
  • GET /api/bash/bash_events
  • GET /api/conversations
  • GET /api/conversations/{}/events
  • GET /api/conversations/{}/workspace
  • GET /api/conversations/{}/workspace/{}
  • GET /api/init
  • POST /api/init
  • POST /api/skills/installed/{}/refresh

@neubig neubig left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, let's remove these

@VascoSch92
VascoSch92 merged commit ba5e38b into main Jun 23, 2026
9 checks passed
@VascoSch92 VascoSch92 added the type: refactor Code refactoring label Jun 24, 2026
@openhands-release-bot openhands-release-bot Bot added the released: v1.27.0 Shipped in v1.27.0 label Jun 25, 2026
@openhands-release-bot

Copy link
Copy Markdown
Contributor

🚀 Released in v1.27.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

released: v1.27.0 Shipped in v1.27.0 type: refactor Code refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants