feat: structured JSON response format for AI refinement#287
Merged
breaking-brake merged 2 commits intomainbreaking-brake/cc-wf-studio:mainfrom Dec 17, 2025
feat/ai-refinement-structured-responsebreaking-brake/cc-wf-studio:feat/ai-refinement-structured-responseCopy head branch name to clipboard
Merged
feat: structured JSON response format for AI refinement#287breaking-brake merged 2 commits intomainbreaking-brake/cc-wf-studio:mainfrom feat/ai-refinement-structured-responsebreaking-brake/cc-wf-studio:feat/ai-refinement-structured-responseCopy head branch name to clipboard
breaking-brake merged 2 commits intomainbreaking-brake/cc-wf-studio:mainfrom
feat/ai-refinement-structured-responsebreaking-brake/cc-wf-studio:feat/ai-refinement-structured-responseCopy head branch name to clipboard
Conversation
- Add AIRefinementResponse and AISubAgentFlowResponse types - Update prompts to require structured JSON with status field - Add parseRefinementResponse and parseSubAgentFlowResponse functions - Include aiMessage in refinement results for chat UI display - Fix NodeType enum usage in createMinimalSubAgentFlow - Add raw CLI output to INFO logs for debugging 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- nano-spawn may only set exitCode=143 (128 + SIGTERM) without isTerminated flag - Added exitCode check to timeout detection logic - Fixes TIMEOUT errors being incorrectly reported as UNKNOWN_ERROR 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Merged
github-actions Bot
added a commit
that referenced
this pull request
Dec 17, 2025
## [3.8.0](v3.7.4...v3.8.0) (2025-12-17) ### Features * structured JSON response format for AI refinement ([#287](#287)) ([d16f74e](d16f74e))
Contributor
|
🎉 This PR is included in version 3.8.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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
Implement structured JSON response format for AI workflow refinement to prevent PARSE_ERROR when AI returns non-JSON responses.
Problem
When AI determines no changes are needed, it sometimes returns Japanese explanation text instead of JSON, causing
PARSE_ERROR:Current Behavior
Expected Behavior
Solution
Force AI to always return structured JSON responses:
{ "status": "success", "message": "変更を適用しました", "values": { "workflow": { /* workflow JSON */ } } }Changes
File:
src/extension/services/refinement-service.tsAIRefinementResponseandAISubAgentFlowResponsetype definitionsparseRefinementResponse()andparseSubAgentFlowResponse()functionsstatus,message, andvaluesfieldsaiMessagefield to result interfaces for chat UI displayFile:
src/extension/commands/workflow-refinement.tsFile:
src/extension/services/claude-code-service.tsexitCode === 143(128 + SIGTERM)isTerminatedflagImpact
TIMEOUTinstead ofUNKNOWN_ERRORTesting
🤖 Generated with Claude Code