feat(tools): surface the Nous free tool pool (entitlement + setup prompt)#36153
Conversation
Read the Portal's tool_access claim (JWT + /api/oauth/account) into NousToolAccessInfo and gate managed Tool Gateway access on it: tool_gateway_entitled (paid OR live pool) and per-category tool_gateway_entitled_for(). The pool funds web/image/tts/browser but not video, so per-backend availability, the charge picker (ensure_nous_portal_access coverage_category), and managed defaults all respect coverage. Setup: rebuild prompt_enable_tool_gateway as a per-tool checklist that renders whenever the pool is enabled, lists only pool-covered tools (video excluded for free-pool users), and is framed as the free tool pool for $0 subscribers rather than a paid subscription. get_gateway_eligible_tools now gates and filters off the entitlement snapshot.
🔎 Lint report:
|
| Rule | Count |
|---|---|
invalid-argument-type |
1 |
First entries
tests/hermes_cli/test_nous_subscription.py:344: [invalid-argument-type] invalid-argument-type: Argument to function `prompt_enable_tool_gateway` is incorrect: Expected `dict[str, object]`, found `dict[str, dict[str, str]]`
✅ Fixed issues: none
Unchanged: 4953 pre-existing issues carried over.
Diagnostics are surfaced as warnings — this check never fails the build.
|
@daimon-nous review please. some contracts from the gateway not live yet |
|
Reviewed PR branch (9 commits behind main). Only the 6 claimed files are touched — all changes are net-new infrastructure that doesn't exist on current Verdict: Approve with one nit. Clean design, fail-closed parsing, correct per-category gating, good test coverage, backwards compatible. What it does rightEntitlement model. Fail-closed parsing. Backwards compatibility.
Video gen correctly excluded. UX improvement. Graceful degradation for unreleased account API. When NitStale docstring — Verified
|
|
Post-merge review — this PR was merged before review was requested. Analysis below. Verdict: ✅ LGTM — clean, well-scoped feature. Adds What's right:
Minor observations (not blocking):
22 tests pass, covering pool exclusion, paid inclusion, checklist rendering, selective writes, and regression guards. |
mxnstrexgl
left a comment
There was a problem hiding this comment.
LGTM — automated review passed. No security, quality, or test coverage issues detected.
…esearch#36153) Read the Portal's tool_access claim (JWT + /api/oauth/account) into NousToolAccessInfo and gate managed Tool Gateway access on it: tool_gateway_entitled (paid OR live pool) and per-category tool_gateway_entitled_for(). The pool funds web/image/tts/browser but not video, so per-backend availability, the charge picker (ensure_nous_portal_access coverage_category), and managed defaults all respect coverage. Setup: rebuild prompt_enable_tool_gateway as a per-tool checklist that renders whenever the pool is enabled, lists only pool-covered tools (video excluded for free-pool users), and is framed as the free tool pool for $0 subscribers rather than a paid subscription. get_gateway_eligible_tools now gates and filters off the entitlement snapshot.
What
Wires the Nous Portal free tool pool through Hermes so $0 subscribers (no paid plan, no purchased credits) can use the managed Tool Gateway backends the pool funds — and prompts them to turn those tools on during setup.
Entitlement (read side). Parse the Portal's
tool_access: { enabled, coverage }claim — present on both the OAuth JWT and/api/oauth/account— intoNousToolAccessInfo, and gate managed tools on:tool_gateway_entitled— paid access OR a live pool (coarse "any managed tool")tool_gateway_entitled_for(category)— per-tool; the pool funds web/image/tts/browser/modal but not videoThis replaces the old paid-only gate across feature detection, the charge picker (
ensure_nous_portal_access(coverage_category=…)), managed defaults, andmanaged_nous_tools_enabled. Per-backend availability honours coverage, so a pool user gets image gen but not video.Setup prompt (the new UX).
prompt_enable_tool_gatewayis now a per-tool checklist that renders whenever the pool is enabled (pool-enabled is the trigger), lists only the pool-covered tools (video excluded for free-pool users), and is framed as the "free tool pool" for $0 users instead of a paid subscription. It fires in the existing first-timehermes setup→_model_flow_nouspath and self-limits once the covered tools are already gateway-routed.Contract
tool_access: { enabled, coverage }on the JWT + account API.enabledgates the offer;coverageselects which tools. No new field.tool_gateway_entitled/tool_gateway_entitled_for(category), with the gateway-key → coverage-category map (MANAGED_FEATURE_COVERAGE_CATEGORY).use_gateway: true(+backend/provider/cloud_provider) per chosen tool.The account-API echo of
tool_accessis a separatenous-account-servicechange (needed for the authoritativeforce_freshpath); the JWT already carries the claim, so the default path works without it.Tests
209 passing across
test_nous_subscription,test_tools_config,test_tool_backend_helpers,test_cli_provider_resolution,test_setup,test_setup_model_provider.ruff+tyclean on the changed files. Run per-file (the repo isolates tests viascripts/run_tests_parallel.py; a single combined pytest process has pre-existing cross-file contamination).Note for reviewers
The base entitlement wiring (
tool_accessparsing + per-category gates) landed on this branch without dedicated unit tests; the new setup-prompt tests exercise it indirectly. Happy to backfill direct read-side tests if wanted.