Skip to content

Bug: agent task_create crashes uncaught on invalid title — code-only TASK_TITLE_INVALID gives the calling agent nothing actionable (1 event, 09-02) #3155

Description

@larryro

Source: GlitchTip sweep of demo.tale.dev, 2026-09-02 (evening pass). Tracked on the board as TAL-29. Born after the morning 06:10Z sweep finished querying, so no prior task or repo issue covers it: #1991 (closed) fixed the human create-task form (client trim/max-length); this is the agent/workspace-tool path.

Evidence

  • TALE-PROJECT-12HUncaught ConvexError: {"code":"TASK_TITLE_INVALID"}1 event, 2026-09-02T06:10:25Z, error level. Tags: func: tasks/internal_mutations:agentCreateTask (mutation), request_id e799de1b789564f1. Stack: convex/tasks/internal_mutations.ts:199 (handler) → :148 (trimTitle).
  • The platform's own nightly triage automation tripped it: the event sits 25 seconds before that run created its task (TAL-28, 06:10:50Z) — the agent passed an empty/whitespace (or over-max) title through the workspace task_create tool, got an opaque refusal, and recovered by retrying. Every agent that files tasks can reproduce this, and agent traffic on this surface is growing.

Read

"Title is empty after trim / too long" is an expected validation refusal, and it fails badly three ways:

  1. Code-only error: the ConvexError carries {code: "TASK_TITLE_INVALID"} with no message, no offending value, no limit — the calling agent cannot tell empty-after-trim from over-max or learn TASK_TITLE_MAX. Contrast the platform's own better convention: connectors' INPUT_INVALID carries message + hint + "you passed: …" (TALE-PROJECT-11M), and the Postgres-port twin services/platform/backend/domains/tasks/service.ts:210 (validateTitle) at least throws TaskError('TASK_TITLE_INVALID', 'Invalid title').
  2. Recorded as an uncaught error-level server event — the same expected-refusal-as-uncaught-error class as Bug: request_human_input crashes uncaught when an approval is already pending on the thread — expected conflict surfaced as a plain server Error (5 events, 08-07→08-12) #3111 (approval conflict), Bug: keyless org model resolution throws uncaught NoProviderAvailableError — expected "no AI provider configured yet" onboarding state recorded as error-level server events (8 events, 07-07→07-28, latent) #3129 (keyless org model resolution), and Bug: expected "Unauthenticated" refusals land as uncaught server errors — ~550+ GlitchTip events across 12+ groups, still firing daily #3088's direction 3 (reporting policy).
  3. Validation sits deep in the internal mutation instead of the agent tool boundary (workspace_domain_tools / write shim), so the bridge surfaces a mutation crash rather than a structured invalid_args result.

Module note: convex/tasks/internal_mutations.ts is private-overlay (absent from the public tree — same situation as #3110/#3111/#3129); the Postgres-port backend/domains/tasks/service.ts and backend/core/node_only/sandbox/workspace_domain_tools.ts are public.

Fix direction

  1. Message-carrying refusal: throw ConvexError with code + message + which constraint failed (empty vs > TASK_TITLE_MAX, include the max), aligned with the TaskError shape and the INPUT_INVALID convention, in both the convex overlay and the Postgres port.
  2. Validate at the tool boundary: task_create / task_upsert_by_external_ref normalize+validate the title before invoking the mutation, returning a structured invalid_args result the agent can act on in one round-trip.
  3. Reporting policy: stop recording expected validation refusals as uncaught error-level events (align with Bug: expected "Unauthenticated" refusals land as uncaught server errors — ~550+ GlitchTip events across 12+ groups, still firing daily #3088 direction 3 / Bug: request_human_input crashes uncaught when an approval is already pending on the thread — expected conflict surfaced as a plain server Error (5 events, 08-07→08-12) #3111 / Bug: keyless org model resolution throws uncaught NoProviderAvailableError — expected "no AI provider configured yet" onboarding state recorded as error-level server events (8 events, 07-07→07-28, latent) #3129).

Acceptance

  • An agent calling task_create with "", whitespace, or an over-max title receives a structured refusal naming the constraint and limit; the run can self-correct without guessing.
  • No error-level GlitchTip event is minted for it; TALE-PROJECT-12H stays flat.

Filed from the GlitchTip sweep of 2026-09-02. Board task: TAL-29.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions