Swap Tests
Validates D147: three normal swaps must succeed with config-only changes — zero code edits.
SWAP-1: Provider Swap
Validates: Model API contract, Principle 2 (everything else is swappable)
Setup:
- System running with Provider A (e.g., OpenRouter adapter)
- Standard test conversation completing successfully (message → model → tool call → response)
Procedure:
- Stop the system
- Change
provider_adapterin runtime config to Provider B (e.g., Ollama adapter) - Provide the new adapter config file
- Set the API key / connection environment variable
- Start the system
- Run the same test conversation
Pass criteria:
- Test conversation completes successfully with Provider B
- Zero code changes were required between steps 1 and 6
- Only config file changes and environment variable changes were made
- Gateway, Auth, Your Memory, tools, and clients are completely unmodified
Failure indicators:
- Any source code file was modified
- Any component other than the Agent Loop's adapter needed changes
- The system required a rebuild or recompilation
SWAP-2: Model Swap
Validates: Model API contract, model independence
Setup:
- System running with Model A (e.g., Claude Sonnet via OpenRouter)
- Standard test conversation completing successfully
Procedure:
- Change the model preference in Your Memory preferences file (or adapter config model list)
- Send a new message (no restart required)
Pass criteria:
- Next message is processed by Model B
- Zero code changes were required
- Only a preference or config value was changed
- Response format is identical from the Gateway's perspective (same SSE events)
Failure indicators:
- The Agent Loop required modification to support the new model
- The Gateway needed to know which model was in use
- Tool definitions needed modification for the new model
SWAP-3: Tool Swap
Validates: D51 (tools are data in the environment), Principle 3 (interfaces over implementations)
SWAP-3a: Add a Tool
Setup:
- System running with base tool set
- New tool available (MCP server, CLI wrapper, or native function)
Procedure:
- Install the tool in a
tool_sourcespath - Restart the Agent Loop (or trigger hot-reload if supported)
- Send a message that would benefit from the new tool
Pass criteria:
- Agent Loop discovers the new tool at startup via self-description
- Model can see and use the new tool
- Zero code changes to Agent Loop, Gateway, Auth, or Your Memory
- Only environment changes (tool installed) and optionally preferences updated (always-send set)
SWAP-3b: Remove a Tool
Setup:
- System running with a tool that will be removed
Procedure:
- Remove the tool from its
tool_sourcespath - Remove from always-send preferences if applicable
- Restart the Agent Loop
Pass criteria:
- System functions normally without the removed tool
- Model no longer sees the removed tool in its definitions
- Zero code changes to any component
- No errors — the system gracefully handles the tool's absence
Failure indicators:
- Agent Loop has hardcoded references to specific tools
- Removing a tool causes component failures beyond "tool not available"
- Code changes were required to add or remove the tool