tools: improve routine schema guidance#1089
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
There was a problem hiding this comment.
Pull request overview
This PR improves LLM-facing routine tool schema guidance, removes schema duplication by reusing the runtime routine schemas in strict-schema validation tests, and expands E2E trace coverage for cron/manual/system-event routine creation flows.
Changes:
- Centralize
routine_create/routine_updateparameter schemas into reusable helpers with clearer descriptions. - Reuse the runtime routine schemas in
schema_validatortests to prevent schema drift. - Extend builtin tool E2E trace coverage for cron timezone/context/action fields, manual routines, and system-event filters/tool permissions.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/fixtures/llm_traces/tools/routine_system_event_emit.json | Adds system-event filters and tool permissions, and aligns emitted payload with filters. |
| tests/fixtures/llm_traces/tools/routine_manual_create.json | New trace fixture covering manual routine creation defaults. |
| tests/fixtures/llm_traces/tools/routine_create_list.json | Expands routine_create trace to cover timezone, context paths, lightweight action config, cooldown, and notify fields. |
| tests/e2e_builtin_tool_coverage.rs | Adds DB-level assertions to verify persisted routine trigger/action/notify/guardrails fields for the new traces. |
| src/tools/schema_validator.rs | Stops duplicating routine schemas inline; instead calls the canonical routine schema helpers. |
| src/tools/builtin/routine.rs | Introduces reusable schema helper functions, updates tool schemas to call them, and adds unit tests around schema shape/descriptions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
zmanian
left a comment
There was a problem hiding this comment.
Good refactor -- extracting canonical schema functions eliminates duplication between the tool implementations and schema validator tests. The improved descriptions will meaningfully help LLM tool use accuracy, especially the clarifications about what routine_update can and cannot change.
Note: will conflict with #1108 in routine.rs and e2e_builtin_tool_coverage.rs. Recommend merging this first since it's the larger structural change.
Summary
Test Plan
Notes