anthropics / anthropics/claude-code

Workflow tool's StructuredOutput validator false-rejects valid output ("missing required property" when property is present)

Đang mở
#93,430 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
area:agents area:routines duplicate
Ngôn ngữ chính
Python
Star
145k
Fork
23.1k
Chỉ số merge pull request
Chỉ số pull request đang chờ

Mô tả

### Preflight Checklist

- [x] I have searched [existing issues](https://github.com/anthropics/claude-code/issues?q=is%3Aissue%20state%3Aopen%20label%3Abug) and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code

### What's Wrong?

The Workflow tool's StructuredOutput validator rejects valid output, claiming a required property is missing when it's actually present.

A weekly scheduled Claude Code routine runs 7 parallel subagents, each ending in a StructuredOutput call. Every subagent's output is rejected with an error like:

ERR: Output does not match required schema: root: must have required property 'painPoints'

But the painPoints key IS present in the output - confirmed directly from the raw agent transcript (KEYS: ['painPoints']). The validator is false-rejecting valid, schema-conforming JSON.

This has reproduced across 3+ separate runs over 2 weeks (2026-08-31, and twice on 2026-09-10), identically every time, and survived a script change from parallel to sequential subagent execution - ruling out a concurrency race as the cause.

A compounding, possibly separate issue seen in one of the 2026-09-10 runs: subagents' WebSearch and Bash tool calls were also rejected outright by what looked like a session-level tool-permission fault, forcing agents to fall back to unverified placeholder content.

Impact: the routine cannot complete - 0/7 agents ever produce accepted output when this triggers. Manual retries (re-running later, no script changes) have twice cleared the issue, suggesting it's transient/environmental rather than deterministic.

### What Should Happen?

The StructuredOutput tool should accept output that correctly matches the declared schema. When a subagent returns a JSON object containing all required properties (e.g. painPoints), validation should pass and the Workflow should proceed to the next phase.

### Error Messages/Logs

```shell
KEYS: ['painPoints']
ERR: Output does not match required schema: root: must have required property 'painPoints'
Session/routine references for support to cross-check internally:
- Routine: trig_01XBE2fKzgongx9pkMrdjXGX ("Steer Me & Draw Pro — Weekly Content Pipeline")
- Failed run 1: cse_0165UdbUH5MeUgypgtox2yCK (2026-09-09/10)
- Failed run 2: cse_01T2zbYm6EwXKbgKXQLKQ3J7 (2026-09-10)
- Failed run (prior week): cse_01BS6auGTerL9AMCSCwT2tQ7 (2026-08-31)
```

### Steps to Reproduce

1. Create a Claude Code routine (via claude.ai/code/routines) with a prompt that calls the Workflow tool.
2. The workflow script defines multiple phases, fanning out to 7 parallel subagents via agent(), each of which must end its turn with a StructuredOutput call matching a defined JSON schema (e.g. an object with a required "painPoints" array).
3. Run the routine (scheduled or manual trigger).
4. Observe: every subagent's StructuredOutput call is rejected by the validator with an error such as "Output does not match required schema: root: must have required property 'painPoints'" - even though inspecting the raw subagent transcript confirms the painPoints key IS present in the returned object.
5. Retrying (either immediately, or restructuring the script to run subagents sequentially instead of in parallel) does not reliably fix it - two of three observed failures failed identically on retry. Only an unrelated fresh attempt, later, cleared it once.

Note: this could not be reduced to a minimal single-agent repro within the time available - it has only been observed in this specific 7-agent parallel Workflow. Happy to share the full workflow script on request.

### Claude Model

Sonnet (default)

### Is this a regression?

Yes, this worked in a previous version

### Last Working Version

N/A - cloud routine (claude.ai/code/routines), not a local CLI regression. Same routine succeeded on a prior run (2026-08-31) with no known version change.

### Claude Code Version

v1.46388.3 (Claude Code desktop app - no standalone `claude` CLI installed on this machine)

### Platform

Anthropic API

### Operating System

macOS

### Terminal/Shell

Terminal.app (macOS)

### Additional Information

Important context: this bug occurred entirely within a Claude Code cloud routine sandbox (Linux container, cwd=/home/claude), not in a local terminal session on the OS/Terminal specified above - those fields were left at their defaults since this form doesn't have a "cloud routine" environment option. The actual execution environment for every failure described here was Anthropic's routine-runner infrastructure (claude.ai/code/routines), not a local macOS/Terminal.app session.

Routine: trig_01XBE2fKzgongx9pkMrdjXGX ("Steer Me & Draw Pro — Weekly Content Pipeline"), triggered on a weekly cron schedule (Mondays 12:00 UTC) plus manual re-runs.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

Start by reproducing the Workflow tool's StructuredOutput validation failure in the named 7-agent cloud routine and compare the raw agent transcript with the validator error for the painPoints property. Cross-check the listed routine and failed run references, then verify that valid schema-conforming output is accepted and that the workflow proceeds to its next phase.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
json
Lĩnh vực
api, cloud, testing-qa
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.