Repository navigation
fix(mcp): let create/update_agent_schedule write the validation config - #2761
Merged
vybe merged 2 commits intoSep 15, 2026
Merged
Conversation
`list_agent_schedules` and `get_agent_schedule` have returned `validation_enabled`, `validation_prompt` and `validation_timeout_seconds` since VALIDATE-001 landed, and neither write tool accepted them. Both schemas are strict, so the fields could not be smuggled through either -- the post-execution validation hook could be observed over MCP but never configured over it. The backend takes all three on both write paths (`ScheduleCreate`, `ScheduleUpdateRequest`), so this is an MCP-layer parity gap and needs no backend change. Same shape as Abilityai#85, which added `timeout_seconds` / `allowed_tools` / `model` to these two tools; the `validation_*` trio was never added. `validation_timeout_seconds` is bounded 30-600 in the Zod schema, so an out-of-range value is refused by name rather than reaching the backend, matching how `retry_delay_seconds` already handles the same range. The `validation_enabled` description states what enabling it costs: one extra execution on the same agent after each technically-successful run, a `business_status = failed_validation` plus one operator alert on FAIL/PARTIAL, and no retry -- retries key on technical failure, and validation only runs after technical success (Abilityai#1573). Refs Abilityai#2759
Keep both the ent#498 deliver_to_workspace_email fields and the Abilityai#2759 validation_* fields in schedules.ts / types.ts. The description assertion in schedules.validation.test.ts now reads the zod .description accessor, because dev is on zod 4, which no longer serialises it into JSON.stringify.
L4XB
force-pushed
the
fix/2759-mcp-schedule-validation-fields
branch
from
September 15, 2026 10:10
83561cb to
1fbb317
Compare
vybe
approved these changes
Sep 15, 2026
vybe
left a comment
Contributor
There was a problem hiding this comment.
merge-train: validated on #2820 (batch of 6, full suite green). Lane B — /validate-pr + /review; coverage mutation-proven (4 mutants, all caught; 375 tests pass). Consumer chain traced MCP schema → client → backend persist → scheduler runtime read.
4 tasks
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.
Fixes #2759.
The gap
list_agent_schedulesandget_agent_schedulehave returnedvalidation_enabled,validation_promptandvalidation_timeout_secondssince VALIDATE-001 landed. Neithercreate_agent_schedulenorupdate_agent_scheduleaccepted them, and both schemas are strict (additionalProperties: false), so they could not be smuggled through either — the post-execution validation hook could be observed over MCP but never configured over it.The backend already takes all three on both write paths (
ScheduleCreateindb_models.py:150-152,ScheduleUpdateRequestinmodels.py:3046-3048), so this is purely an MCP-layer parity gap. No backend change.Same shape as #85, which added
timeout_seconds/allowed_tools/modelto these two tools; thevalidation_*trio was never added alongside them. I copied that pattern rather than inventing one.Against the issue's acceptance list
if (args.x !== undefined)block, so an omitted field is not sent and the stored value survives. Pinned byomits what was not passed, so a stored value survives.validation_enabledstaysfalse. Pinned byleaves the safe default alone when they are omitted, which is the accept control: validation is not free, so a schedule created without asking for it must not get it.validation_timeout_secondsisz.number().int().min(30).max(600).optional(), matching both the range documented on the column and the existingretry_delay_secondsbound. A bad value is a schema rejection naming the field, not a 500 from the backend.business_status = failed_validationand raises one high-priority operator alert, and does not retry, because retries key on technical failure and validation only runs after technical success (Post-execution validation hook: run a validation playbook in clean context and record business-success status #1573). A cell asserts that text is actually in the schema, because it is the only place a caller will read it.Two acceptance items I could not do here:
list_agent_schedulesreads it back → a fired run produces a linked validation execution and abusiness_statuson the parent) needs a live backend and scheduler; these tests drive the tools against a fakeTrinityClient, the same seamreports.test.tsandgit.test.tsuse.The adjacent item the issue lists as out of scope — repo-declared schedules (
template.yaml→schedules:) also not carrying these fields, related to #1198 — is untouched.Tests
src/mcp-server/src/tools/schedules.validation.test.ts, 9 cells. Each was checked against a mutant that breaks the thing it names:declares the fields in its parameter schemasends all three fields to the backendomits what was not passed, so a stored value survivesrejects a timeout outside the documented 30-600 rangecellsnames the cost of enabling validation in the tool description