Skip to content

feat: v0.8.0 — pais repro harness + drop SDK-owned chat defaults - #26

Merged
dshahnaz merged 1 commit into
mainfrom
feat/pais-repro-harness
Apr 18, 2026
Merged

dshahnaz merged 1 commit into
mainfrom
feat/pais-repro-harness

Conversation

@dshahnaz

Copy link
Copy Markdown
Owner

Summary

Two changes in one release:

1. New pais repro command — reproducible chat-experiment harness

One-shot, non-interactive command that stands up a fresh KB + index + agent from supplied fixtures, ingests the test-suites dir, runs each supplied prompt, and bundles everything into a single zip for hand-off / regression archival.

```bash
pais repro \
--suites-dir ./test-suites/ \
--instructions ./instructions.md \
--prompts ./prompts/per-pr/p20242.md \
--prompts ./prompts/combined.md \
--max-tokens 2048 \
--output /tmp/pais-repro.zip
```

Bundle layout: `manifest.json` (full recipe + KB/index/agent ids), `responses/.json` (per-prompt: prompt_tokens, completion_tokens, finish_reason, latency_ms, response_text, errors), `doctor.md`, `chat-errors/*.json`, `pais.log`.

Side-by-side comparison across prompts makes scaffolding-vs-tokenizer-vs-RAG diagnosis trivial.

`--cleanup` deletes the agent + KB after bundling (off by default). `--include-instructions` opts the instructions text into the bundle (off by default; only its byte length + SHA-256 land in the manifest otherwise).

2. ⚠️ Behavior change — drop SDK-owned chat defaults

`ChatCompletionRequest.max_tokens` default changed from `500` to `None`; `temperature` from `0.7` to `None`. Same v0.7.4 pattern: `model_dump(exclude_none=True)` drops `None` but not numeric defaults, so the SDK was silently sending `max_tokens=500` on every chat request → `finish_reason=length` even when the user expected the full output.

To restore the previous behavior in your code, pass values explicitly: `ChatCompletionRequest(messages=[…], max_tokens=500, temperature=0.7)`.

Test plan

  • `uv run pytest -q` — 413 passed (+6 new)
  • `uv run ruff check && uv run ruff format --check && uv run mypy src` — clean
  • New tests:
    • `test_chat_request_wire_shape.py` (3): default body has only `messages+stream`; explicit values survive; explicit `None` excludes
    • `test_repro_cmd.py` (3): end-to-end mock run with assertions on zip layout + manifest + per-prompt JSON; `--include-instructions` opt-in; `--cleanup` removes resources
  • CI green on 3.10 / 3.11 / 3.12

🤖 Generated with Claude Code

Two changes in one release.

1) New `pais repro` command — one-shot, non-interactive harness that
   builds a fresh KB+index+agent from supplied fixtures (test-suites
   dir, instructions md, prompt files), runs every prompt against the
   agent, and bundles per-prompt metrics + doctor snapshot + chat-error
   JSONs + log into a single zip suitable for support hand-off and
   regression archival. Captures prompt_tokens, completion_tokens,
   finish_reason, latency, full response text, and request_id per turn.

2) Drop SDK-owned defaults from ChatCompletionRequest — max_tokens and
   temperature default to None (was 500 and 0.7), so model_dump's
   exclude_none drops them and the server picks. Same v0.7.4 pattern.
   New tests/test_chat_request_wire_shape.py pins the body shape.

Tests: 413 passed (+6 new).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@dshahnaz
dshahnaz merged commit 2de12fa into main Apr 18, 2026
3 checks passed
@dshahnaz
dshahnaz deleted the feat/pais-repro-harness branch April 18, 2026 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant