Conversation
19 tasks
This was referenced Sep 15, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Do not merge: this is dependent on an Inference API change that is not in prod yet.
Summary
agent_keycompatibility fields.paid_service_accessand usable credits instead of subscription price alone./usage, status/setup/tool messaging, and built-in prompts to recommend subscription vs credit top-up based on account state.Validation
python -m py_compile ...for changed Python modulesgit diff --check./scripts/run_tests.sh tests/hermes_cli/test_nous_account.py tests/hermes_cli/test_models.py tests/tools/test_tool_backend_helpers.py tests/test_account_usage.py tests/agent/test_prompt_builder.py tests/hermes_cli/test_auth_nous_provider.py tests/hermes_cli/test_auth_commands.py tests/agent/test_credential_pool.py tests/hermes_cli/test_runtime_provider_resolution.py tests/hermes_cli/test_nous_subscription.py tests/hermes_cli/test_status.py tests/hermes_cli/test_status_model_provider.py tests/tools/test_managed_media_gateways.py tests/tools/test_managed_browserbase_and_modal.py tests/tools/test_terminal_requirements.py tests/run_agent/test_run_agent.pyResult: 841 passed, 1 skipped.
Full agent plan
Summary
Update Hermes to use the NAS OAuth access JWT directly as the Nous inference bearer token, matching the RS256 JWT entitlement design. Hermes will stop minting opaque inference tokens, persist the JWT through the existing
agent_keycompatibility paths, and make free/paid decisions from live NAS account entitlement data.Source contracts checked:
/Users/rewbs/code/nous-account-service/src/app/api/oauth/account/route.tspaid_access = total_usable_credits > 0/Users/rewbs/code/api/src/middleware/nas_jwt_auth.tsKey Changes
/api/oauth/agent-keyminting inhermes_cli/auth.pywith JWT aliasing:access_tokenas the runtimeapi_key;agent_key,agent_key_expires_at,agent_key_obtained_at, and credential-pool fields so existing key readers keep working.resolve_nous_runtime_credentials(..., force_mint=True)becomes a compatibility path that forces a JWT refresh rather than minting an opaque key.agent_key; the JWT is already present there asaccess_token, and opaque keys were not shared previously.Entitlement And Menus
GET {portal}/api/oauth/accountusing the NAS access JWT and parses:paid_service_access.paid_access/allowedhas_active_subscriptionactive_subscription_is_paidsubscription_tiertotal_usable_creditsfree_tier = not paid_access/model nous, status output, managed-tool gating, and recommended auxiliary model selection to use this entitlement helper.402 And Prompt Guidance
402and relevantSUBSCRIPTION_REQUIRED/credit errors:run_agent.py;/usageviaagent/account_usage.py, rendering live subscription tier, paid-access state, and usable credit balances from NAS.Tests
/api/oauth/agent-key;api_keyequals the access JWT;agent_keyprovider and credential-pool fields;/usagerenders Nous subscription and credit state.scripts/run_tests.shfor auth, runtime provider resolution, models, setup/status menus, account usage, prompt builder, managed tools, and run-agent billing handling.Assumptions
agent_keyfields, not by introducing a new required storage key./api/oauth/account; JWT claims are only a fallback for runtime authentication, not for fresh menu decisions.