Multiple bugs: thinking block ordering, settings schema validation, agent frontmatter

Open 💬 12 comments Opened Jan 25, 2026 by emregurhan

Bug Report — Multiple Issues

Environment

  • Model: Claude Opus 4.5 (claude-opus-4-5-20251101)
  • Platform: macOS (Darwin 25.3.0)
  • Date: 2025-01-25

---

Bug 1: Thinking Block Ordering Error

Error:

{
  "type": "invalid_request_error",
  "message": "messages.29.content.0: If an assistant message contains any thinking blocks, the first block must be thinking or redacted_thinking. Found text."
}

Request ID: req_011CXTCAWtq7XQ1St7ovhfN8

Description: During a normal CLI session, the API returns this error. An assistant message is being constructed where a text block precedes a thinking block. The user has no control over message payload ordering — this appears to be an internal issue in how Claude Code constructs API requests.

Impact: Session becomes unusable. Only workaround is starting a new conversation.

---

Bug 2: Settings Schema Validation Rejects Valid Files

Error:

Settings Error
.claude/settings.json
  └ $schema: Invalid value. Expected one of: "https://json.schemastore.org/claude-code-settings.json"

Files with errors are skipped entirely, not just the invalid settings.

Description: Claude Code's settings validator only accepts $schema: "https://json.schemastore.org/claude-code-settings.json". However, if settings.json was generated with a different but valid JSON schema URI (e.g., http://json-schema.org/draft-07/schema#), the entire file is skipped instead of just ignoring the $schema field.

Expected behavior:

  • The $schema field should either be optional/ignored, or
  • Claude Code should not skip the entire settings file over a metadata field
  • If Claude Code itself generates settings files, it should use the correct schema value

---

Bug 3: Agent Files Created Without Required Frontmatter

Error:

Agent Parse Errors
└ Failed to parse agent file(s):
  └ example-agent.md: Missing required "name" field in frontmatter

Description: Multiple agent .md files fail to parse because they lack the required YAML frontmatter with a name field. If these files were generated or scaffolded by Claude Code (or by Claude in a session), the tool should include the required frontmatter automatically.

Expected format:

---
name: Agent Name
---

# Agent content here...

Current behavior: Agent files are created without frontmatter, then Claude Code rejects them on startup.

---

Summary

| Bug | Severity | Workaround |
|-----|----------|------------|
| Thinking block ordering | High | Start new conversation |
| Settings schema validation | Medium | Manually fix $schema value |
| Agent frontmatter missing | Low | Manually add name frontmatter |

All three issues point to Claude Code generating content that it later rejects during validation.

View original on GitHub ↗

This issue has 12 comments on GitHub. Read the full discussion on GitHub ↗