feat(agents): Agent Designer Phase 1 — contract + binding persistence (foundation)#591
Merged
Merged
Conversation
…dels Phase 1 (PR-1) of the Agent Designer. Pure library, zero behavior change: legacy Assistants read unchanged and no caller passes the new fields yet. - AgentModelConfig (D3 governed single-select; field is model_settings/ alias modelConfig to dodge pydantic's reserved model_config — R3) - AgentBinding (open kind on read, KNOWN_BINDING_KINDS for request validation) - optional model_settings + bindings on Assistant (additive) - compat.effective_bindings/to_agent_view (D2): absent bindings synthesize a knowledge_base binding reffing the assistant id (KB's only stable identity, F4 deferred — R4); absent model maps to None, never fabricated (R1) - Decimal-safe serialization for modelConfig.params floats Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Phase 1 (PR-2). The Agent fields now round-trip through the rag-assistants store and are validated at write time by composing existing RBAC checks (D4). Legacy clients are unaffected: the SPA sends none of the new fields and the AssistantResponse surface is unchanged. - service.create_assistant/update_assistant thread bindings + model_settings; to_ddb_safe on write / from_ddb on read so modelConfig.params floats survive DynamoDB (Decimal); explicit [] replaces bindings, absent leaves them untouched - app_api/agents/services/binding_validation.py composes model access (ModelAccessService), memory resolve_permission (viewer+/editor+), the implicit-KB rejection, and inert shape-only checks for tool/skill (D4/D5) - assistants POST/PUT validate then pass through; validation raises 4xx outside the create handler's generic except so it isn't masked as 500 - tests: validation matrix (incl. inert no-RBAC guarantee), persistence round trip, legacy no-field read Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Agent Designer — Phase 1 (foundation, backend only)
First slice of the Agent Designer epic. Evolves the
rag-assistantsstore in place (D2) into a primitive-agnostic Agent contract. Zero behavior change to existing clients — the SPA sends none of the new fields andAssistantResponseis unchanged. No new surface is exposed yet (the/agents/*router lands dark in the next PR).Two commits, kept split for review:
PR-1 — Agent contract + compat mapping (pure library)
AgentModelConfig(D3 governed single-select; field ismodel_settings/aliasmodelConfigto dodge pydantic's reservedmodel_config) andAgentBinding(openkindon read,KNOWN_BINDING_KINDSfor request validation)model_settings+bindingsonAssistant(additive)compat.py(D2): absentbindingssynthesize aknowledge_basebinding reffing the assistant id (the KB's only stable identity — F4 deferred); absent model →None, never fabricatedmodelConfig.paramsfloatsPR-2 — Persist bindings + modelConfig with design-time validation
create/updatethread the new fields;to_ddb_safe/from_ddbso float params survive DynamoDB (Decimal)app_api/agents/services/binding_validation.pycomposes existing RBAC (D4): model access (ModelAccessService), memoryresolve_permission(viewer+/editor+), inert shape-only checks fortool/skillPOST/PUTvalidate then pass through (4xx raised so it isn't masked as 500)Design note — knowledge_base bindings
Refined from the spec sketch:
knowledge_baseis synthesized on read, rejected on write in Phase 1. The KB index (vector_index_id) is not user-configurable and the agent id doesn't exist at create time, so an author-settable KB binding is pointless/chicken-and-egg. Revisit when F4 (first-class KBs) lands.Testing
71 tests pass, including all pre-existing assistant tests (no regression) and the architecture import-boundary gate. New: compat mapping (10), binding validation matrix incl. the inert no-RBAC guarantee (15), persistence round-trip (3).
Follow-ups (this epic)
/agents/*alias router behindAGENTS_API_ENABLED(default off, deploys dark)memory_spacebinding🤖 Generated with Claude Code