Skip to content

Add LLM subscription client methods#178

Open
neubig wants to merge 3 commits into
mainfrom
add-llm-subscription-client
Open

Add LLM subscription client methods#178
neubig wants to merge 3 commits into
mainfrom
add-llm-subscription-client

Conversation

@neubig

@neubig neubig commented May 23, 2026

Copy link
Copy Markdown
Member

Summary

  • add typed response models for LLM subscription auth endpoints
  • add OpenAI subscription status, model list, device start/poll, and logout helpers to LLMMetadataClient
  • cover endpoint paths and token non-exposure in API client tests

Tests

  • npm test -- --runTestsByPath src/tests/api-clients.test.ts --runInBand
  • npm run build

This PR was created by an AI agent (OpenHands) on behalf of the user.

Issue

Fixes #201

This PR description update was created by an AI agent (OpenHands) on behalf of Graham Neubig.

Co-authored-by: openhands <openhands@all-hands.dev>

@all-hands-bot all-hands-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Acceptable - Implementation is clean and follows existing patterns, but has missing test coverage and type inconsistencies that should be addressed.


Was this automated review useful? React with 👍 or 👎 to this review to help us measure review quality.
Workflow run: https://github.com/OpenHands/typescript-client/actions/runs/26336719042

Comment thread src/__tests__/api-clients.test.ts
Comment thread src/models/api.ts
Comment thread src/models/api.ts

@all-hands-bot all-hands-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Acceptable - Implementation is clean and follows existing patterns. Previous test coverage gap has been addressed. One minor type consistency issue remains.

[TESTING COVERAGE]
✅ All 5 methods now have test coverage (getOpenAISubscriptionModels test added)
✅ Token non-exposure verified
✅ Endpoint paths verified

[RISK ASSESSMENT]

  • [Overall PR] ⚠️ Risk Assessment: 🟢 LOW

Adding new client methods to existing LLMMetadataClient with comprehensive test coverage. No breaking changes to existing functionality. Standard CRUD operations following established patterns.

VERDICT:
Worth merging: Core implementation is solid, test coverage complete, only minor type style improvement suggested

KEY INSIGHT:
Previous review feedback has been addressed - missing test coverage added and type definitions improved from number | string | null to number | null.


Was this automated review useful? React with 👍 or 👎 to this review to help us measure review quality.
Workflow run: https://github.com/OpenHands/typescript-client/actions/runs/26410852540

Comment thread src/models/api.ts
Comment thread src/models/api.ts
…client

Co-authored-by: openhands <openhands@all-hands.dev>
@neubig neubig force-pushed the add-llm-subscription-client branch from 5513585 to b025805 Compare May 28, 2026 21:24

neubig commented May 28, 2026

Copy link
Copy Markdown
Member Author

Updated the TypeScript client branch through b025805: merged current main, kept subscription client methods/tests green, and resolved the prior review threads. This remains the temporary git pin used by agent-canvas until this PR is merged and released.\n\nThis comment was generated by an AI agent (OpenHands) on behalf of neubig.

neubig commented May 28, 2026

Copy link
Copy Markdown
Member Author

CI is green on b025805, all review threads are resolved, and this PR is ready for another review/merge gate pass.\n\nThis comment was generated by an AI agent (OpenHands) on behalf of neubig.

all-hands-bot commented Jun 17, 2026

Copy link
Copy Markdown

Review complete.

This review was performed through OpenHands Cloud Automation. You can log in and view the conversation here.

@all-hands-bot all-hands-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Good taste — Elegant, simple solution that follows existing patterns in the codebase.

This PR adds LLM subscription client methods for OpenAI OAuth device flow authentication. The implementation is clean and consistent with the existing LLMMetadataClient patterns.

[TESTING GAPS]

  • [src/tests/api-clients.test.ts] Good coverage of happy paths and token non-exposure verification. Consider adding a test for the error case when pollOpenAISubscriptionDeviceLogin times out or returns an error response to ensure proper error handling.

[RISK ASSESSMENT]

  • [Overall PR] ⚠️ Risk Assessment: 🟢 LOW
    This is a pure addition of new client methods with no breaking changes. The OAuth device flow implementation follows a well-established pattern. Tests verify token non-exposure, which is critical for security.

VERDICT:
Worth merging: Clean implementation that follows project conventions.

KEY INSIGHT:
The OAuth device flow implementation correctly avoids exposing API tokens during the subscription authentication process.

This review was generated by an AI agent (OpenHands) on behalf of the user through OpenHands Automation. View conversation

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Track PR #178: Add LLM subscription client methods

3 participants