Repository navigation
M3: agent loop on the live sandbox wire (sandbox_live tier) - #62
Conversation
New tests/test_agent_sandbox_live.py (2 tests, marked sandbox_live, skipped unless PERMIT_PAYPAL_CLIENT_ID/SECRET are set, plus PERMIT_PAYPAL_MERCHANT_ID; never runs in CI): - over-cap agent attempt BLOCKED with zero sandbox wire calls, not even an OAuth fetch, BLOCKED receipt written, chain verifies; - allowed agent spend creates a REAL order on the PayPal sandbox, PayPal itself refuses authorize with ORDER_NOT_APPROVED, pipeline raises ApprovalRequired with the cap reservation held, and the order reads back over the wire in CREATED state. Verified live 2026-10-23: 2 passed against the real sandbox. Default suite: 406 passed, 3 skipped, plain and -O (409 collected); with credentials: 408 passed, 1 skipped. No authorization, capture, or money movement in this tier: buyer approval is the principal's PayPal sign-in, and post-approval resume/capture remain proven at the transport boundary in tests/test_agent_sandbox_e2e.py. README evidence line and submission-checklist sandbox row updated to match; e2e docstring now points at the live tier.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
CodeQL flagged the substring host check in the live test as py/incomplete-url-substring-sanitization (high). Parse the URL and compare the hostname exactly. Live tier re-verified: 2 passed.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 15f0e68167
ℹ️ 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".
| with pytest.raises(ApprovalRequired) as exc_info: | ||
| tools.attempt_spend(SPEND_CENTS, "widget") |
There was a problem hiding this comment.
Exercise the live rail through the actual agent loop
When this live test runs, it invokes SpendTools.attempt_spend directly, so it never exercises agent.react.run_agent or _execute_tool. This distinction is material here: _execute_tool catches ApprovalRequired and converts it into a generic error observation, meaning the actual agent loop does not receive the order ID, approval URL, or structured approval-required state asserted by this test. Consequently, the new README and checklist claim that the agent loop ran on the live sandbox wire is unsupported; drive this scenario through run_agent and assert its resulting observation/transcript.
Useful? React with 👍 / 👎.
What
Closes the M3 honest limit recorded 2026-10-20: the agent loop had never run on the live sandbox wire. New
tests/test_agent_sandbox_live.py(2 tests,sandbox_livetier, credentials-gated bytests/conftest.py, never in CI):over_remaining_capwith zero sandbox wire calls (not even an OAuth fetch), BLOCKED receipt written, ledger chain verifies.ApprovalRequiredwith the cap reservation held and a real approval URL; the order reads back over the wire in CREATED state.Also carries the pending local README evidence-line correction (755ea5c) with its count updated for the new tests, updates the submission-checklist sandbox row, and points the e2e docstring at the live tier.
Verified
scripts/sandbox_smoke.pypass the same morning: OAuth OK, order created, status read).python -O(409 collected). With credentials: 408 passed, 1 skipped.demo.pychain VERIFIED (16 receipts); ruff clean on the new file.Honest limits
No authorization, capture, or money movement in this tier: a sandbox order cannot be authorized until a human buyer approves it at PayPal checkout (the principal's sign-in tap, same as the 2026-10-05 launch beats). Post-approval resume and capture remain proven at the transport boundary in
tests/test_agent_sandbox_e2e.py. The six beats have still not been run as one live sandbox session.