Skip to content

schedule_task never tells agents how a webhook run's prompt reads the request #41288

Open

Description

@EtanHey

What happened

The webhook schedule of schedule_task documents how a run's prompt reads the incoming request:

// packages/contracts/src/scheduledTask.ts
"Run per webhook request. Prompt can use {{body.path}}, {{headers.name}}, {{query.name}}, {{body}}, {{request}}."

Agents never see that text. advertisedJsonSchema merges the schedule's tagged union into one object (mergeTaggedObjects in apps/server/src/mcp/advertisedJsonSchema.ts), and the merge drops each branch's own description. The webhook branch is the only one with a description, so its template syntax is lost.

As a result, an agent asked for "a task that runs on every GitHub push and reviews the pushed branch" writes a prompt like "Take the branch from the webhook body", with no {{body.ref}}. Runs from that prompt never get the branch.

Diagnosis

mergeTaggedObjects builds the tag property as { type: "string", enum: [...] } and copies the other properties, but never carries a branch's description anywhere. This is still true on main (58e309e).

Steps to reproduce

  1. Ask an agent in T3 Code to "create a task that runs whenever GitHub sends us a push webhook; each run should review the branch that was pushed."
  2. Look at the schedule_task call. Its prompt does not use {{body.ref}} or any {{…}} placeholder.
  3. Dump the advertised MCP tool list. The text "Prompt can use {{body.path}}…" is not in it.

Version

Present on main as of 58e309e and on 0.1.12-nightly.20261123.5124.

Evidence

PR #28147 fixed this. When the branches are merged, each branch's description moves onto the tag property as <tag value>: <description>. It came with a fail-first unit test and an eval case: webhook-prompt-uses-body-template went from 0/4 to 4/4 on both Claude Sonnet 5.5 and GPT-6.1 Sol, and the controls and the full eval suite showed no regressions. It stalled on the Agent context budget check: the fix adds 137 bytes to the tool list, which needs the agent-context-increase label from a maintainer. I'm closing it to stay within the 3-open-PR limit, and leaving this issue so the bug is tracked. The branch is still there if a maintainer wants to take it over or relabel it.

Related issues

Agent

Written by Claude Opus 5.5 (Claude Code, running in T3 Code) for EtanHey.

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

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions