v0.10.0 — cheap schema retries via ephemeral workspace + session continue
Up through v0.9.1, schema-mode retries on /openai/v1/chat/completions
replayed the full original prompt — a 100k-token request needing 3
retries paid 400k input tokens.
v0.10.0:
- Schema request + no x-aicodebox-workspace → ephemeral
/tmp/aicodebox/<uuid>/ workspace (mkdir mode 0o700), cleaned up
in `finally` after the request returns.
- run_with_json_retry runs retries with no_continue=False +
minimal corrective prompt (error + directive + schema, ~500
tokens) instead of replaying the full original input.
- Caller-provided workspace → fresh-session retry fallback
(v0.9.1 behavior); we can't guarantee isolation in a workspace
we don't own.
Library-level: run_with_json_retry gains
continue_session_on_retry (default False — /run callers
unchanged).
Safety: _cleanup_ephemeral_workspace refuses paths outside
EPHEMERAL_WORKSPACE_ROOT. stream+schema 400 check moved earlier so
the rejected path doesn't leak an ephemeral dir.
164 tests pass (+5 new in test_oai_schema.py and
test_usage_accumulation.py).
Migration: none. Schema requests without a workspace header now
cost ~100x less on retries.