Skip to content

feat(providers): xai-coding-plan — resolution chain fixes + am423 web auth - #26437

Closed
avirweb wants to merge 2 commits into
NousResearch:mainfrom
avirweb:feat/xai-coding-plan-provider
Closed

feat(providers): xai-coding-plan — resolution chain fixes + am423 web auth#26437
avirweb wants to merge 2 commits into
NousResearch:mainfrom
avirweb:feat/xai-coding-plan-provider

Conversation

@avirweb

@avirweb avirweb commented May 15, 2026

Copy link
Copy Markdown

xAI Coding Plan provider — full resolution chain fixes + am423 web auth flow

Changes

Resolution chain fixes (the /model "Unknown provider" bug)

  • providers.py: Added xai-oauth, xai-coding-plan, xai coding plan, x.ai coding plan aliases to ALIASES dict. Added HERMES_OVERLAYS entry for transport/base_url.
  • auth.py: Added xai-coding-plan to PROVIDER_REGISTRY.
  • models.py: Curated model list (grok-build, grok-4-1-fast, grok-code-fast-1, grok-4.3, grok-4.3-latest). Proper aliases for all variants.
  • xai-oauth plugin: Re-registered as xai-coding-plan with fallback_models.
  • main.py _model_flow_xai_oauth: Uses curated list instead of live API fetch (xAI API returns all models, not just coding-plan eligible).

Model picker fix

  • xai-coding-plan: _PROVIDER_MODELS entry now returns 5 coding-plan-specific models matching grok CLI (grok-build + cache-derived).
  • Fixed in both _PROVIDER_MODELS and plugin fallback_models.

ACP auth flow (credits am423)

  • acp_adapter/auth.py: build_auth_methods() with terminal setup + web auth.
  • acp_adapter/server.py: initialize() delegates to build_auth_methods(); authenticate() handles TERMINAL_SETUP_AUTH_METHOD_ID and WEB_AUTH_METHOD_ID.

Verification

  • resolve_provider_full("xai-oauth") → ProviderDef(id='xai-coding-plan')
  • resolve_provider_full("xai-coding-plan") → valid ProviderDef
  • PROVIDER_REGISTRY["xai-coding-plan"] → exists
  • curated_models_for_provider("xai-coding-plan") → [grok-build, grok-4-1-fast, ...]
  • Setup wizard now shows 5 coding-plan models

- xai-coding-plan profile with Grok CLI OAuth delegation
- Curated model list: grok-build, grok-4-1-fast, grok-code-fast-1, grok-4.3, grok-4.3-latest
- providers.py ALIASES + HERMES_OVERLAYS for resolution chain
- Legacy xai-oauth alias registration for backward compatibility
- models.dev mapping and test plugin count bump
@daimon-nous daimon-nous Bot added type/feature New feature or request P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/acp Agent Communication Protocol adapter comp/plugins Plugin system and bundled plugins provider/xai xAI (Grok) area/auth Authentication, OAuth, credential pools labels May 15, 2026
@daimon-nous

daimon-nous Bot commented May 15, 2026

Copy link
Copy Markdown
Contributor

Overlaps significantly with #25941 (xAI Coding Plan OAuth provider via grok CLI delegation). This PR extends the resolution chain and adds ACP auth flow. Also related to #25968.

- Import Grok CLI OAuth tokens from ~/.grok/auth.json
- resolve_xai_coding_plan_credentials with expiry/refresh handling
- _login_xai_coding_plan flow with grok login --device-auth
- ProviderConfig entry for xai-coding-plan in PROVIDER_REGISTRY
- Config persistence with force_default_model for atomic provider/base_url/model
- credential_pool seeding for same-provider fallback
- Tests for token expiry, credential resolution, and config persistence
@avirweb
avirweb force-pushed the feat/xai-coding-plan-provider branch from ff9226b to 3a503f0 Compare May 15, 2026 16:08
@avirweb avirweb closed this May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/auth Authentication, OAuth, credential pools comp/acp Agent Communication Protocol adapter comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/cli CLI entry point, hermes_cli/, setup wizard comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have provider/xai xAI (Grok) type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants