mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-05-19 08:01:17 +00:00
fix: pass response via env var in record.sh has_api_error (SC2259) (#1559)
The heredoc overrode piped stdin, so $response never reached python3. sys.stdin.read() got empty input, making API error detection silently fail during live fixture recording. Pass data via environment variables instead. Agent: test-engineer Co-authored-by: B <6723574+louisgv@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
c1f730c69a
commit
3af5005896
1 changed files with 4 additions and 4 deletions
|
|
@ -317,10 +317,10 @@ has_api_error() {
|
|||
local cloud="$1"
|
||||
local response="$2"
|
||||
|
||||
echo "$response" | python3 << VALIDATION_EOF 2>/dev/null
|
||||
import json, sys
|
||||
d = json.loads(sys.stdin.read())
|
||||
cloud = '$cloud'
|
||||
_RESPONSE="$response" _CLOUD="$cloud" python3 << 'VALIDATION_EOF' 2>/dev/null
|
||||
import json, sys, os
|
||||
d = json.loads(os.environ['_RESPONSE'])
|
||||
cloud = os.environ['_CLOUD']
|
||||
|
||||
# Helper: data keys that indicate success responses (not errors)
|
||||
success_keys = {'servers','images','ssh_keys','flavors','sizes','regions','count','results','id','name','slug','status','ipv4'}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue