mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-05-20 01:11:18 +00:00
fix(growth): handle multi-line json:candidate extraction (#3185)
The Claude output contains pretty-printed JSON spanning multiple lines.
`tail -1` only grabbed the last line ("}"). Use `tr -d '\n'` to join
all lines into a single JSON string before POSTing to SPA.
Co-authored-by: Claude <claude@anthropic.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Ahmed Abushagur <ahmed@abushagur.com>
This commit is contained in:
parent
32fad1c389
commit
0ece17d92e
1 changed files with 2 additions and 2 deletions
|
|
@ -156,9 +156,9 @@ fi
|
|||
# --- Phase 3: Extract candidate and POST to SPA ---
|
||||
CANDIDATE_JSON=""
|
||||
|
||||
# Extract the json:candidate block from Claude's output
|
||||
# Extract the json:candidate block from Claude's output (may be multi-line)
|
||||
if [[ -f "${CLAUDE_OUTPUT_FILE}" ]]; then
|
||||
CANDIDATE_JSON=$(sed -n '/^```json:candidate$/,/^```$/{/^```/d;p;}' "${CLAUDE_OUTPUT_FILE}" | tail -1)
|
||||
CANDIDATE_JSON=$(sed -n '/^```json:candidate$/,/^```$/{/^```/d;p;}' "${CLAUDE_OUTPUT_FILE}" | tr -d '\n')
|
||||
fi
|
||||
|
||||
if [[ -z "${CANDIDATE_JSON}" ]]; then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue