Skip to content

feat: v0.8.2 — config templates + agent diagnose + richer error dumps - #28

Merged
dshahnaz merged 1 commit into
mainfrom
feat/templates-and-diagnostics
Apr 18, 2026
Merged

dshahnaz merged 1 commit into
mainfrom
feat/templates-and-diagnostics

Conversation

@dshahnaz

Copy link
Copy Markdown
Owner

Summary

The recipe (paste-ready):

```bash
pais agent create --template field-proven \
--name --model openai/gpt-oss-120b --index-id
```

That sets the 5 fields whose null-server-defaults were 502'ing on the user's deployment: `completion_role="assistant"`, `session_max_length=10000`, `session_summarization_strategy="delete_oldest"`, `index_reference_format="structured"`, `chat_system_instruction_mode="system-message"`.

Added

  • `--template ` on `pais agent create` (plus 3 new field flags). Templates: `field-proven` / `minimal` / `custom` for agents; `test-suite-bge` / `-arctic` / `code-rag` / `custom` for indexes; `local-files-manual` / `custom` for KBs. Explicit flags always beat seeds.
  • `pais templates list [--kind ...]`
  • `pais agent dump ` — full server JSON + `__diagnostic` (missing recommended fields, binding mode). Bypasses pydantic defaults so it shows truth on the wire.
  • `pais agent diagnose ` — pass/fail check; exits 1 on misses; warns on huge `session_max_length`.

Improved (zero-config)

  • chat-errors/*.json now includes `prompt_token_estimate` (no HF needed), `request_body`, `response_headers` (auth stripped), inline `agent_dump`.
  • `PaisError.response_headers` carried through the transport.
  • HF graceful fallback: `pais.dev.token_budget` falls back to char-based estimation when HuggingFace is unreachable. One `pais.tokenizer.fallback_chars` warning per process. `pais repro` no longer dies on corp networks.

Test plan

  • `uv run pytest -q` — 429 passed (+13 new)
  • `uv run ruff check && uv run ruff format --check && uv run mypy src` — clean
  • New tests:
    • `test_templates.py` (9): template structure + apply_template + `pais templates list` + `--template field-proven` produces expected wire body + explicit flag beats template + unknown-template error
    • `test_agent_dump_and_diagnose.py` (4): dump shows missing fields, diagnose minimal exits 1, diagnose field-proven exits 0, WARN on session_max_length=100000
  • CI green on 3.10 / 3.11 / 3.12

🤖 Generated with Claude Code

The recipe (paste-ready):

  pais agent create --template field-proven \
    --name <n> --model openai/gpt-oss-120b --index-id <uuid>

Added:
- Named config templates for kb/index/agent (`pais templates list`)
- --template flag + 3 new agent flags (--completion-role,
  --index-reference-format, --chat-system-instruction-mode)
- pais agent dump <id> — full server-side agent JSON + __diagnostic
- pais agent diagnose <id> — pass/fail check vs. field-proven recipe

Improved (zero-config):
- chat-errors/*.json now includes prompt_token_estimate (no HF needed),
  request_body, response_headers (auth stripped), inline agent_dump
- PaisError carries response_headers; transport plumbs them through
- pais.dev.token_budget gracefully falls back to char-based estimation
  when HF unreachable (corp networks, SSL cert issues, etc.)

Memory: feedback_pais_agent_undocumented_defaults.md documents the
5-field recipe and why server defaults can break gpt-oss-120b chat.

Tests: 429 passed (+13 new).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@dshahnaz
dshahnaz merged commit da8ccfe into main Apr 18, 2026
3 checks passed
@dshahnaz
dshahnaz deleted the feat/templates-and-diagnostics branch April 18, 2026 19:07
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