Spaces:
Chris4K
/
Paused

lewtun HF Staff OpenAI Codex commited on
Commit
d7637ba
·
unverified ·
1 Parent(s): 1e1fe1f

Fix Pro entitlement checks (#239)

Browse files

* Fix Pro entitlement checks

Normalize HF Pro and paid org plan detection, allow premium model selection with quota enforcement, and clarify HF Jobs credit billing copy.

Co-authored-by: OpenAI Codex <codex@openai.com>

* Limit premium quota to personal Pro

Ignore org membership for premium-model quota so users need personal HF Pro for the higher cap, while dev mode uses the Pro tier for local testing.

Co-authored-by: OpenAI Codex <codex@openai.com>

* Scope model switch errors to model picker

Show model switch failures through local ChatInput state instead of rendering the shared agent error field globally.

Co-authored-by: OpenAI Codex <codex@openai.com>

* Restrict premium quota detection to Pro accounts

Co-authored-by: OpenAI Codex <codex@openai.com>

* Use boolean Pro signal for premium quota

Co-authored-by: OpenAI Codex <codex@openai.com>

* Use documented isPro field for quota tier

Co-authored-by: OpenAI Codex <codex@openai.com>

* Remove dead global chat error state

Co-authored-by: OpenAI Codex <codex@openai.com>

---------

Co-authored-by: OpenAI Codex <codex@openai.com>

14 files changed +377 -254
Files changed (14)
agent/tools/jobs_tool.py+5-4
backend/dependencies.py+17-27
backend/routes/agent.py+37-63
backend/user_quotas.py+2-2
frontend/src/components/Chat/ChatInput.tsx+49-2
frontend/src/components/ClaudeCapDialog.tsx+57-53
frontend/src/components/JobsUpgradeDialog.tsx+1-1
frontend/src/hooks/useAgentChat.ts-6
frontend/src/hooks/useUserQuota.ts+1-1
frontend/src/lib/sse-chat-transport.ts+2-2
frontend/src/store/agentStore.ts+4-9
tests/unit/test_agent_model_gating.py+143-79
tests/unit/test_plan_normalization.pyAdded+57
tests/unit/test_user_quotas.py+2-5