Repository navigation
Conversation
…hen listing sim_getProvidersAndModels sent a test prompt to every provider/model on each call, so the provider list took many seconds to load and the frontend hung. It now returns the stored providers without any LLM call. sim_createValidator and sim_updateValidator now probe the validator's own provider (before touching the DB) and return `llm_provider_available`. The validator is saved either way, so validators with broken keys can still be created on purpose; the frontend shows a warning when the probe fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
|
Reviewed at 6f85e7b. The change is sound: listing providers no longer sends a paid test prompt to every provider on each call, the startup path (
|
|
Legatus audit: Approved (commit 6f85e7b) No blocking findings. The change removes LLM probes from provider listing and checks the selected provider during validator creation/update, warning on failure. Verified against
Audit worktree removed. No changes pushed or GitHub comments posted. |
|
/run-e2e all |
Ticket: DXP-569
What changed
sim_getProvidersAndModelssent a test prompt ("respond with ok") to every stored provider/model each time it was called, with a 20 s timeout per probe. That made the provider list take many seconds to load, and the frontend hung while it loaded. As the ticket suggests, the check now runs when a validator is created instead.backend/protocol_rpc/endpoints.pyget_providers_and_modelsreturns the stored providers and makes no LLM calls. It no longer needsgenvm_manager.create_validatorandupdate_validatortakegenvm_manager. They runcheck_provider_is_availablefor the validator's own provider before writing to the DB, so no transaction stays open during the LLM call. The response now includesllm_provider_available: bool.create_random_validator(s)is unchanged: it already filters out unavailable providers when it picks them.rpc_methods.py: injectsgenvm_managerintosim_createValidatorandsim_updateValidator, and drops it fromsim_getProvidersAndModels.stores/node.ts: after create, clone or update, ifllm_provider_available === false, it shows awarnnotification: "LLM provider check failed: Validator saved, but provider/model did not answer a test prompt…".Assumptions
tests/integration/icontracts/tests/test_error_llm.py) create validators with invalid or unknown API keys on purpose and expectsim_createValidatorto succeed. Rejecting those would break them, and it would also break anyone who sets up a validator before their key is ready.llm_provider_available, which is added to the validator dict that create and update return. Clients that don't know it can ignore it.sim_updateValidatorprobes on every call, including stake-only edits. This keeps the logic simple, and an update is an explicit user action.sim_replaceValidators(atomic batch replace) is not probed, so bulk setups stay fast.sim_getProvidersAndModelsstill returnsis_available/is_model_available, now alwaystrue(asget_all_dictalready set them). The frontend fields and the "(potential config issue)" labels stay for compatibility, but they no longer trigger from that listing.backend/protocol_rpc/fastapi_endpoint_generator.pyis left untouched. Nothing imports it, and its registrations were already out of sync with the current endpoint signatures.How it was tested
pytest tests/unit -n auto. Result: 1892 passed, 14 skipped.ruff checkandblackare clean.test_get_providers_and_models_does_not_probe_llms, plustest_create_validator_probes_provider_without_blockingandtest_update_validator_probes_provider_without_blocking(each parametrised over an available and an unavailable provider; the validator is saved in both cases).test_simulator_sessions.pyandtest_rpc_methods.pyfor the newgenvm_managerargument.npm run type-checkpasses.vitest runruns 224 tests, all passed, including 3 new store tests for the warning on create and update. ESLint and Prettier are clean on the changed files.🤖 Generated with Claude Code