Skip to content

fix: plan tool argument resilience and diagnostic rejections - #256

Merged
jkyberneees merged 2 commits into
mainfrom
fix/plan-tool-arg-resilience
Sep 19, 2026
Merged

jkyberneees merged 2 commits into
mainfrom
fix/plan-tool-arg-resilience

Conversation

@jkyberneees

Copy link
Copy Markdown
Contributor

What

The plan tool rejected malformed calls with uninformative errors (silently dropped keys reported only as got 0), forcing multiple blind retries.

PlanStore.Execute now diagnoses the envelope before the typed switch:

  • Rejections name the received top-level keys and the expected shape (bounded echo — clamped keys, capped list length)
  • Missing step ids are auto-assigned (collision-safe against explicit ids and existing plan steps on revise paths)
  • Bare string step entries coerce to {title} with auto ids
  • A single wrapper object carrying steps is unwrapped with an inference note
  • Ambiguity stays a hard error (two step lists under different keys), gated on key presence not decoded length

Fail-closed validation and state atomicity unchanged.

Verification

  • RED-first: 9 taxonomy tests failing before the fix, green after (internal/loop/plan_args_resilience_test.go)
  • 3-judge adversarial review (diff-only); all findings fixed with regression tests (bounded key echo, presence-based ambiguity gate, trimmed-id dedupe)
  • go test ./internal/loop/ -count=1 ok; go test -race -run TestPlan ok; go vet clean
  • docs/PLANNING.md updated (argument-resilience section)

The plan tool rejected malformed calls with uninformative errors (silently
dropped keys reported only as 'got 0'), forcing multiple blind retries.
Execute now diagnoses the envelope before the typed switch: rejections
name the received keys and expected shape; missing step ids are
auto-assigned (collision-safe against existing plan steps); bare string
step entries coerce to titles; a single wrapper object carrying steps is
unwrapped with an inference note. Ambiguous two-array input stays a hard
error. Fail-closed validation and state atomicity unchanged.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 19, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
odek afcc1d6 Commit Preview URL

Branch Preview URL
Sep 19 2026, 02:32 PM

@jkyberneees
jkyberneees force-pushed the fix/plan-tool-arg-resilience branch from 71078c2 to 032f185 Compare September 19, 2026 14:31
…GO-2026-4961)

govulncheck flagged three webp/vp8l vulnerabilities reachable through
vision_tool.go image.DecodeConfig, failing CI on main. v0.45.0 is the
newest version compatible with the repo's go 1.25 directive (v0.46.0
requires go 1.26).
@jkyberneees
jkyberneees force-pushed the fix/plan-tool-arg-resilience branch from 032f185 to afcc1d6 Compare September 19, 2026 14:31
@jkyberneees
jkyberneees merged commit 86caa44 into main Sep 19, 2026
10 checks passed
@jkyberneees
jkyberneees deleted the fix/plan-tool-arg-resilience branch September 19, 2026 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant