Repository navigation
fix(platform): name the title limit when task_create refuses - #3529
Merged
Merged
Conversation
An agent's task_create with a title over 200 characters reached the domain, which refused it as a bare TASK_TITLE_INVALID. The bridge relayed "TASK_TITLE_INVALID: the domain refused these arguments.", so the model could not tell what to change. With a parentTaskId the parent's scope read ran first and answered not_found instead. The task_create branch now refuses a title longer than TASK_TITLE_MAX, measured trimmed as validateTitle measures it, before any read or mutation. The invalid_args message names the limit and the title's length. The tool signature states "title: string (≤ 200 characters)", and both read the shared constant. Unit tests cover the over-long refusal, the exact-limit boundary and the signature. The automation-run tool lane checks the refusal through /api/tools/execute on real Postgres and that no card is written.
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.
What changed
An agent's
task_createwith a title over 200 characters went all the way toagentCreateTaskTrusted. TherevalidateTitlerefused it as a bareTASK_TITLE_INVALID, and the bridge relayed:{"status":"invalid_args","message":"TASK_TITLE_INVALID: the domain refused these arguments."}The model could not tell what to change. With a
parentTaskIdit gotnot_foundinstead, because the parent's scope read ran before anything looked at the title.workspace_domain_tools.ts): thetask_createbranch refuses a title longer thanTASK_TITLE_MAXright after the non-empty check, before any read or mutation. It measures the trimmed title, asvalidateTitledoes, so the tool refuses nothing the domain would take:{"status":"invalid_args","message":"The task title is capped at 200 characters (this one has 209) — shorten it and put the detail in \"description\"."}workspace_tools_bridge.ts):workspace_statusnow liststitle: string (≤ 200 characters). Both strings readTASK_TITLE_MAXfromcore/tasks/helpers.ts, where the task limits live, so they cannot drift from the domain.workspace_tools_bridge.test.ts):agentCreateTaskruns.checkAutomationRunToolLanesends one over-long title through the real/api/tools/executedoor and checks that no card is written.tests/manual/reference/automation.md.task_upsert_by_external_refis unchanged. It truncates an over-long title on purpose (truncateImportedTitle), and an empty title is already refused at its boundary.Refs #3155. That issue's acceptance is now met on the public tree. Empty and whitespace-only titles were already refused at the tool boundary with a message, this PR covers the over-max case, and the tool path records no error event (the refusal is returned as a result, not thrown). Its fix direction 1 names the Convex overlay, which has since been retired. I left closing the issue to a maintainer.
How I verified it
bunx vitest run --project serveronworkspace_tools_bridge.test.ts,domains/sandbox/dispatch-routes.test.tsanddomains/sandbox/shim.test.ts: 72/72 passed.origin/main's two implementation files and the new tests kept, 2 of the 3 new tests fail. The over-long call answersnot_found, and the signature lacks the limit. The boundary test passes there too, which is intended: it guards against refusing too much.backend:integration, filtered run (ITEST_LANES=checkAutomationRunToolLane) on a local PG 16 + pg_search + pgvector cluster:origin/main's implementation it fails, with the door answeringTASK_TITLE_INVALID: the domain refused these arguments..automation-run tool laneanddocument_create authority, fail identically onorigin/main. Everydocument_createanswersinvalid_argsbecause this sandbox has no S3 endpoint: the lane's blob store is only seeded withITEST_S3_ENDPOINT. This is environmental and has nothing to do with this change.tscon a scoped config over the changed files plusdispatch-routes.tsandintegration-check.tsis clean.oxlint --type-awareon the four TS files is clean.oxfmt --checkis clean.tools/opengrep/run.shon the changed files reports 0 findings.bun run lint:manualpasses.tsc,bun run check, the full suites) are left to CI. The sandbox's 4 GB cap cannot run them.Left open
task_create'sdescriptionoverTASK_DESCRIPTION_MAX(20,000) still comes back as the bareTASK_DESCRIPTION_INVALID. The same pre-check would fix it; it was outside this task.validateTitlestill throws'Invalid title'with no limit. The agent path no longer reaches it for length. The REST door refuses a long title asmust be at most 200 characters, and the app form caps input withmaxLength.