Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new “advisor-style” escalation guard to the AgentGuard SDK so applications can run a cheaper default model and selectively route hard turns to a stronger model, while keeping provider invocation logic in the app (not inside the SDK).
Changes:
- Introduces
BudgetAwareEscalation,EscalationSignal, andEscalationRequired(new core module + public exports). - Adds coverage across guards/exports/DX/smoke/example-starters, plus a runnable local-only example.
- Updates docs and release-facing artifacts (README, PyPI README sync, changelog, roadmap, proof outputs).
Reviewed changes
Copilot reviewed 25 out of 26 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/agentguard/escalation.py | New escalation guard implementation and signal primitives. |
| sdk/agentguard/guards.py | Re-exports escalation symbols via agentguard.guards. |
| sdk/agentguard/init.py | Adds escalation types to public top-level API and __all__. |
| sdk/tests/test_guards.py | Adds unit tests for escalation signals/behavior and updates guard tests. |
| sdk/tests/test_exports.py | Ensures new guard/signal/exception are exported and in __all__. |
| sdk/tests/test_dx.py | Adds repr/docstring DX checks for the new guard. |
| sdk/tests/test_smoke.py | Extends smoke imports to include new public exports. |
| sdk/tests/test_example_starters.py | Executes the new example in CI-style test coverage. |
| sdk/tests/test_architecture.py | Updates allowed-module lists to include escalation.py and new guard. |
| examples/budget_aware_escalation.py | New local-only example demonstrating escalation decision + tracing. |
| examples/README.md | Documents the new example and how to run it. |
| docs/guards/budget-aware-escalation.md | New guide page describing semantics, signals, and boundary. |
| README.md | Adds guard to table and includes a brief usage snippet + guide link. |
| sdk/PYPI_README.md | Adds guard to PyPI README table and usage snippet + GitHub link. |
| scripts/generate_pypi_readme.py | Marks the new guard doc path as unreleased for link rewriting. |
| CHANGELOG.md | Notes the new feature under Unreleased. |
| ops/03-ROADMAP_NOW_NEXT_LATER.md | Marks budget-aware escalation guard as done. |
| PR_DRAFT.md | Updates draft PR metadata to match this feature. |
| MORNING_REPORT.md | Updates report narrative/validation summary for this feature. |
| AGENTS.md | Updates module map and public API surface documentation. |
| proof/budget-aware-escalation/verification.txt | Captures validation commands/results for the PR. |
| proof/budget-aware-escalation/source-notes.md | Documents primary-source rationale for advisor framing. |
| proof/budget-aware-escalation/blog-draft.md | Draft copy describing the feature. |
| proof/budget-aware-escalation/report.txt | Captured CLI report output for the example trace. |
| proof/budget-aware-escalation/example-output.txt | Captured console output from running the example. |
| proof/budget-aware-escalation/budget_aware_escalation_traces.jsonl | Captured trace output from running the example. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2393ea2dc1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
PR Draft
Title
Add a budget-aware escalation guard for advisor-style model routing
Summary
BudgetAwareEscalation,EscalationSignal, andEscalationRequiredso apps can keep a cheaper default model and escalate only hard turns to a stronger modelScope
sdk/agentguard/escalation.pyproof/budget-aware-escalation/Non-goals
Proof
python -m ruff check sdk/agentguard/guards.py sdk/agentguard/escalation.py sdk/agentguard/__init__.py sdk/tests/test_guards.py sdk/tests/test_exports.py sdk/tests/test_dx.py sdk/tests/test_smoke.py sdk/tests/test_example_starters.py sdk/tests/test_architecture.py examples/budget_aware_escalation.py scripts/generate_pypi_readme.pypython -m pytest sdk/tests -v --cov=agentguard --cov-report=term-missing --cov-fail-under=80python scripts/sdk_release_guard.pypython scripts/sdk_preflight.pypython -m bandit -r sdk/agentguard -s B101,B110,B112,B311 -qpython scripts/generate_pypi_readme.py --writePYTHONPATH=sdk python examples/budget_aware_escalation.pySaved artifacts
proof/budget-aware-escalation/example-output.txtproof/budget-aware-escalation/budget_aware_escalation_traces.jsonlproof/budget-aware-escalation/source-notes.mdproof/budget-aware-escalation/blog-draft.md