feat(portal): add agent extension config endpoints and block component#495
feat(portal): add agent extension config endpoints and block component#495sytone wants to merge 1 commit into
Conversation
Closes #407 (Phase 3) ## Changes ### ConfigController.cs - GET /api/config/agents/{agentId}/extensions/{extensionId} - returns 200 with JSON, 204 if no config, 404 if agent not found - PUT /api/config/agents/{agentId}/extensions/{extensionId} - writes extension config via MutateAsync, returns 200/404 - Both endpoints guard against the 'defaults' pseudo-agent ### AgentExtensionConfigBlock.razor (new) - Schema-driven collapsible block component for per-agent extension config - Loads from GET endpoint, saves via PUT - Hidden entirely when extension has no schema fields - Field types: string, bool (checkbox), integer; sensitive fields use password input with lock badge - Dirty tracking, save/reset actions, 4s auto-dismiss status ### Tests - 8 unit tests in AgentExtensionConfigControllerTests (GET 200/204/404, PUT 200/404, defaults guard) - 7 bunit tests in AgentExtensionConfigBlockTests (no-schema, header, collapse, expand, sensitive, pre-populate, error)
|
CI: All checks passing (build-and-test, CodeQL, TruffleHog, patterns, deps) LGTM - all 3 phases of #407 now have PRs. Ready to merge. |
|
CI: ✅ All checks passing LGTM — ready to merge. |
sytone
left a comment
There was a problem hiding this comment.
Farnsworth Review — PR #495
CI: ✅ All checks passing
Merge conflicts: ✅ Clean (MERGEABLE)
Conventional commit title: ✅ feat(portal): add agent extension config endpoints and block component
Test coverage:
- ✅ 8 controller unit tests (GET/PUT extension config, 404/400 paths)
- ✅ 7 bunit tests (AgentExtensionConfigBlock renders, schema fields, collapsible)
- 1497 gateway + 344 blazor pass
Spec completeness vs #407 Phase 3: Satisfies the extension config block requirement. Schema-driven approach means no component changes needed when extension schemas evolve. Correct sub-issue of #407 decomposition.
LGTM. Ready to merge.
|
Closing as part of a planned hard-reset of the in-flight branch set so the new domain-model refactor can land on a clean trunk. Audit verdict: keep Rationale: Configuration-layer; orthogonal. The new plan (in session state) reshapes core types: Citizen (User+Agent union), Vogen-generated value objects, ThreadId removed in favour of composite ChannelAddress, mark-not-delete compaction, centralised If this work is still wanted, refile as a new issue/PR against the post-refactor contracts. |
Closes #407 (Phase 3 of 3)
Changes
ConfigController.csTwo new endpoints for per-agent extension config management:
GET /api/config/agents/{agentId}/extensions/{extensionId}200with the raw JSON object stored underagents.{agentId}.extensions.{extensionId}204 No Contentif the agent exists but has no config for this extension404if the agent is not found oragentId == "defaults"PUT /api/config/agents/{agentId}/extensions/{extensionId}agents.{agentId}.extensions.{extensionId}viaPlatformConfigWriter.MutateAsync200on success,404if agent not found oragentId == "defaults"AgentExtensionConfigBlock.razor(new component)Schema-driven collapsible block for per-agent extension config in the portal.
Intended to be embedded in
AgentDetailPanel.razor(Phase 2, PR #494) for each loaded extension that declares aConfigSchema.Features:
SchemafieldsGETendpoint on expandstring(text input),bool(checkbox),integer(text with int parse);sensitive: truefields usepasswordinput with lock badgeTests
AgentExtensionConfigControllerTests(8 tests): GET 200/204/404, PUT 200/404, defaults guard, pre-existing integration test contamination avoided by using controller unit testsAgentExtensionConfigBlockTests(7 bunit tests): no-schema renders nothing, header with name, collapsed by default, expand shows fields, sensitive field password input, pre-populated from existing config, API error shows error text