mirror of
https://github.com/outbackdingo/optimclaw.git
synced 2026-08-25 14:53:34 +00:00
* test: add 29 E2E trace tests for worker, threading, tools, workspace, and routines (#571-575) Add comprehensive E2E test coverage across five test files: - e2e_worker_coverage (7 tests): parallel tool calls, error feedback, unknown tools, invalid params, rate limiting, iteration limits, planning mode - e2e_thread_scheduling (3 tests + 2 deferred): multi-turn state, undo/redo, concurrent dispatch - e2e_builtin_tool_coverage (8 tests): time parse/diff/invalid, routine CRUD/history, job create/status/list/cancel, HTTP replay - e2e_workspace_coverage (6 tests): chunked search, multi-doc search, hybrid search, directory tree, document lifecycle, identity in system prompt - e2e_routine_heartbeat (5 tests): cron triggers, event matching, cooldown enforcement, heartbeat findings, empty checklist skip Infrastructure: extend TestRig with database/workspace/trace_llm accessors, register job and routine tools by default, add with_extra_tools() for custom stub tools. Includes 24 JSON trace fixtures across worker/, threading/, tools/, and workspace/. Co-Authored-By: Claude Opus 4.6 <[email protected]> * fix: use 6-field cron format in routine_create_list fixture The cron 0.13 crate accepts both 6 and 7 fields, but the routine_create tool documents 6-field format. Align the fixture to match. [skip-regression-check] Co-Authored-By: Claude Opus 4.6 <[email protected]> * fix: eliminate vacuous passes and silently-skipped assertions in E2E tests - job_create_status: replace job_status (needs dynamic UUID) with list_jobs, assert both succeed via completed() not just started() - job_list_cancel: keep cancel_job but explicitly assert it fails with invalid canned job_id "latest", verify create_job + list_jobs succeed - unknown_tool_name: add !is_empty() guard before .all() to prevent vacuous pass on empty iterator - workspace tests: change `if let Some(ws)` to `.expect()` so assertions are never silently skipped when workspace/trace_llm is available [skip-regression-check] Co-Authored-By: Claude Opus 4.6 <[email protected]> * feat: add template substitution to TraceLlm for dynamic tool result forwarding Add {{call_id.json_path}} template syntax to trace fixtures, enabling tool results from one step to flow into subsequent steps' arguments. TraceLlm extracts variables from Role::Tool messages (stripping the safety layer's <tool_output> XML wrapper and unescaping entities) and substitutes them in canned tool_call arguments before returning. This fixes job_create_status and job_list_cancel tests to properly test job_status and cancel_job with real dynamic UUIDs from create_job, instead of using invalid canned IDs that silently failed. Also adds tool result content assertions to job_create_status to verify the actual tool output contains expected data (job_id, title). [skip-regression-check] Co-Authored-By: Claude Opus 4.6 <[email protected]> * fix: address PR review feedback on E2E tests - undo_redo_cycle: assert exactly 3 turns instead of >= 2 - tool_error_feedback: use tempfile::tempdir() instead of hardcoded /tmp path, patch fixture path at runtime for CI portability - worker_timeout → iteration_limit: rename to accurately describe what's tested - post_plan_work_remaining → simple_echo_flow: rename, test doesn't exercise planning - identity_in_system_prompt: seed IDENTITY.md before test, assert system prompt contains the seeded content instead of just checking Role::System exists [skip-regression-check] Co-Authored-By: Claude Opus 4.6 <[email protected]> * fix: strengthen workspace E2E test assertions per PR review - write_chunk_search: assert memory_search was called and returned payment/architecture-related results - multi_document_search: assert memory_search was called for cross-document search - hybrid_search_with_embeddings: assert both memory_write and memory_search were called to confirm write-then-search pipeline - directory_tree: assert tree output contains expected alpha/beta project paths [skip-regression-check] Co-Authored-By: Claude Opus 4.6 <[email protected]> --------- Co-authored-by: Claude Opus 4.6 <[email protected]>
58 lines
4.9 KiB
JSON
58 lines
4.9 KiB
JSON
{
|
|
"model_name": "test-write-chunk-search",
|
|
"expects": {
|
|
"tools_used": [
|
|
"memory_write",
|
|
"memory_search"
|
|
],
|
|
"all_tools_succeeded": true,
|
|
"min_responses": 1
|
|
},
|
|
"steps": [
|
|
{
|
|
"request_hint": {
|
|
"last_user_message_contains": "document"
|
|
},
|
|
"response": {
|
|
"type": "tool_calls",
|
|
"tool_calls": [
|
|
{
|
|
"id": "call_mw_long",
|
|
"name": "memory_write",
|
|
"arguments": {
|
|
"content": "# System Architecture\n\nThis document describes the complete architecture of our distributed system.\n\n## Overview\n\nThe system consists of multiple microservices communicating via message queues. Each service is independently deployable and follows the single responsibility principle. The main services include: User Service, Order Service, Payment Service, Notification Service, and Analytics Service.\n\n## User Service\n\nThe User Service manages user authentication, authorization, and profile management. It uses JWT tokens for session management and bcrypt for password hashing. The service exposes a REST API on port 8001 and maintains its own PostgreSQL database for user data. Rate limiting is applied at 100 requests per minute per user.\n\n## Order Service\n\nThe Order Service handles the complete order lifecycle from creation to fulfillment. Orders go through states: Created, Confirmed, Processing, Shipped, Delivered, or Cancelled. Each state transition is recorded as an event in the event store. The service uses an event-sourced architecture with CQRS for read optimization.\n\n## Payment Service\n\nThe Payment Service integrates with multiple payment providers including Stripe, PayPal, and cryptocurrency gateways. It implements the saga pattern for distributed transactions, ensuring consistency across the Order and Inventory services. Failed payments trigger automatic retry with exponential backoff.\n\n## Notification Service\n\nThe Notification Service sends alerts via email, SMS, push notifications, and webhooks. It uses a template engine for message formatting and supports multiple languages. Notifications are queued in RabbitMQ with priority levels and delivery guarantees.\n\n## Analytics Service\n\nThe Analytics Service collects metrics from all other services via event streams. It processes data in real-time using Apache Kafka and stores aggregated results in ClickHouse for fast querying. Dashboards are served via a Grafana integration.\n\n## Infrastructure\n\nAll services are containerized with Docker and orchestrated via Kubernetes. The cluster runs on AWS EKS with auto-scaling policies based on CPU and memory utilization. Service mesh is provided by Istio for traffic management, security, and observability.\n\n## Database Strategy\n\nEach microservice owns its database schema. Cross-service data access happens only through published APIs or event streams. Database migrations are managed via Flyway and executed during deployment. Read replicas are used for analytics queries to avoid impacting production workloads.\n\n## Security\n\nAll inter-service communication uses mTLS certificates managed by cert-manager. External traffic passes through AWS ALB with WAF rules. Secrets are stored in HashiCorp Vault and injected at runtime. Regular penetration testing is conducted quarterly.\n\n## Monitoring\n\nThe observability stack includes Prometheus for metrics, Jaeger for distributed tracing, and ELK for log aggregation. SLOs are defined per service with error budgets tracked via SLI dashboards. PagerDuty handles on-call alerting with escalation policies.\n\n## Deployment\n\nCI/CD pipelines run on GitHub Actions with stages for lint, test, build, and deploy. Feature flags are managed via LaunchDarkly for gradual rollouts. Blue-green deployments minimize downtime, with automatic rollback on health check failures.\n\n## Performance Requirements\n\nThe system targets 99.9% uptime with P99 latency under 200ms for API calls. Load testing with k6 validates performance before each release. CDN caching reduces origin load for static assets and frequently accessed API responses.",
|
|
"target": "context/architecture.md"
|
|
}
|
|
}
|
|
],
|
|
"input_tokens": 100,
|
|
"output_tokens": 50
|
|
}
|
|
},
|
|
{
|
|
"response": {
|
|
"type": "tool_calls",
|
|
"tool_calls": [
|
|
{
|
|
"id": "call_ms_chunk",
|
|
"name": "memory_search",
|
|
"arguments": {
|
|
"query": "payment service saga pattern"
|
|
}
|
|
}
|
|
],
|
|
"input_tokens": 200,
|
|
"output_tokens": 20
|
|
}
|
|
},
|
|
{
|
|
"response": {
|
|
"type": "text",
|
|
"content": "I wrote the architecture document and searched for payment-related content. The search found the Payment Service section describing the saga pattern for distributed transactions.",
|
|
"input_tokens": 300,
|
|
"output_tokens": 30
|
|
}
|
|
}
|
|
]
|
|
}
|