Fix/override delete - #3950
Fix/override delete#3950
Conversation
…deleted params no longer reappear)
…y overrides take effect, and edit-dialog connectivity probe uses stored api_key
There was a problem hiding this comment.
🟡 Changes recommended
The new /temporary_healthcheck “reuse stored api_key” behavior can leak stored API keys to an arbitrary caller-supplied base_url unless additional safeguards are added.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
This PR addresses two operator-facing issues in Nexent’s model/agent configuration flows: (1) custom parameter deletions in the agent “model params override” dialog not persisting, and (2) “max token”/capacity override values not taking effect at runtime.
Changes:
- Frontend: introduces explicit merge/diff logic for
extra_params.__custom__, persisting deletions asnullmarkers instead of silently re-inheriting model-level values. - Frontend/Backend: adds an optional
model_idto the temporary model healthcheck request so edit dialogs can validate connectivity without retyping an API key. - Backend: applies per-agent capacity override fields (W1/W2 capacity fields) from
model_params_overrideinto capacity resolution and runtimeModelConfig.
File summaries
| File | Description |
|---|---|
| frontend/services/modelService.ts | Sends optional model_id in model connectivity verification payloads for edit-mode probes. |
| frontend/app/[locale]/models/components/model/ModelAdvancedSettings.tsx | Adds utilities to merge/diff custom params and to persist deletions via null markers. |
| frontend/app/[locale]/models/components/model/ModelAddDialogV2.tsx | Passes modelId during edit-mode verification to enable backend “reuse stored key” probing. |
| frontend/app/[locale]/agents/components/agent-prompt.tsx | Updates override dialog state handling so deleted custom params do not reappear and are saved as explicit removals. |
| backend/consts/model.py | Extends ModelRequest with model_id for edit-dialog connectivity probes. |
| backend/apps/model_managment_app.py | Uses model_id to optionally fall back to the stored API key for /temporary_healthcheck. |
| backend/agents/create_agent_info.py | Honors per-agent capacity overrides and supports null custom values as explicit removal markers at runtime. |
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
… spread into INSERT column lists, so a model_id field injected an explicit NULL primary key and broke model creation
…ModelRequest.model_dump() is spread into INSERT column lists, so any non-column field breaks model creation (Unconsumed column names)
…el slot - persistCustomLocalConfig now only writes the slot when it is empty (onboarding) or the submitted model already occupies it
…rd could still steal an occupied default slot when the cache was stale/empty. Default-slot writes now come only from the server (create-time backfill for empty/dangling slots)
…nfig guard could still steal an occupied default slot when the cache was stale/empty. Default-slot writes now come only from the server (create-time backfill for empty/dangling slots)" This reverts commit 2376aa5.
…teway adapter's relative dirname chain resolved two levels short of the package root, so every probe silently fell back to a public URL that is unreachable in offline deployments. Anchor both probe copies on nexent.__file__ so the path survives module moves.
修复智能体配置页面自定义参数删除失败的问题
max token不生效的问题