docs: cover defensive JSON parsing, empty-output retries, and resume caching - #138
Merged
Merged
Conversation
…caching agent() always resolves to raw text unless `schema` is set, and a call whose only attempts ended in a recoverable failure (e.g. AGENT_EMPTY_OUTPUT) is never journaled. Document both facts in README and the workflow-authoring skill, add a defensive-json-parsing example alongside structured-output.js, and note agentRetries: 1-2 as fleet guidance for models with occasional empty output. Refs #134, #135
…g-empty-output # Conflicts: # docs/workflow-context-surfaces.json # docs/workflow-guidance-baseline.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
agent()resolves to raw assistant text unlessschemais set — prompting for "STRICT JSON" does not change the return type. Adds a defensive parse-or-flag pattern to the README and a runnabledefensive-json-parsing.jsexample besidestructured-output.js. (agent() returns assistant TEXT, not parsed JSON — document defensive parsing for workflow authors #134)AGENT_EMPTY_OUTPUT) is never journaled, soresumeFromRunIdreplays the cached prefix and re-runs only that call; recommendagentRetries: 1-2for fleets on models with occasional empty first outputs. (kimi-k3 agents can return AGENT_EMPTY_OUTPUT on first attempt — document agentRetries + resumeFromRunId for fleets #135)Test plan
npm test— 1151 passing, release gate 0 warningstests/workflow-authoring-skill.test.ts(complete / unparseable / missing branches)