← Back to PRs

#23221: fix(cron): recover flat patch params for update action and fix schema

by charojo open 2026-02-22 03:47 View on GitHub →
agents size: S
## Summary - Recovers flat `patch` parameters for the `update` action in `cron-tool.ts`. - Fixes a syntax error (missing braces) in `CronToolSchema` that could lead to runtime validation issues. - Adds E2E tests verifying recovery for `name` and `enabled` fields when flattened at the top level. ## Context Smaller models (such as Qwen and Ollama running locally on WSL) frequently struggle with complex nested JSON schemas. They often flatten parameters directly into the top-level arguments object rather than nesting them under the expected keys (e.g., `patch`). This change brings the same resilience to the `update` action that was recently added to the `add` action, ensuring consistent behavior across different LLM providers. ## Verification - Ran 32/32 tests in `src/agents/tools/cron-tool.e2e.test.ts` using `vitest.e2e.config.ts`. - All tests passed, including the new `recovers flat patch params for update action` test case. ## AI-assisted - [x] Generated with Gemini Antigravity <!-- greptile_comment --> <h3>Greptile Summary</h3> Adds flat parameter recovery for the `update` action and fixes a schema definition issue. The changes mirror the existing flat parameter recovery pattern from the `add` action, allowing smaller models to pass parameters at the top level instead of nested under `patch`. - Fixed `CronToolSchema` by adding missing `{ additionalProperties: true }` option, which is required for the schema to accept flat parameters - Added recovery logic for `update` action that detects when `patch` is missing or empty and rebuilds it from top-level parameters - Includes E2E test verifying recovery for `name` and `enabled` fields <h3>Confidence Score: 5/5</h3> - This PR is safe to merge with minimal risk - The changes follow an established pattern from the `add` action, fix a schema definition bug, and include comprehensive test coverage. The implementation is straightforward and backward-compatible. - No files require special attention <sub>Last reviewed commit: d3d0ab5</sub> <!-- greptile_other_comments_section --> <sub>(4/5) You can add custom instructions or style guidelines for the agent [here](https://app.greptile.com/review/github)!</sub> <!-- /greptile_comment -->

Most Similar PRs