Skip to content

M3: agent loop on the live sandbox wire (sandbox_live tier) - #62

Merged
FetchDoge merged 3 commits into
mainfrom
m3/sandbox-live-agent
Oct 23, 2026
Merged

FetchDoge merged 3 commits into
mainfrom
m3/sandbox-live-agent

Conversation

@FetchDoge

Copy link
Copy Markdown
Owner

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_live tier, credentials-gated by tests/conftest.py, never in CI):

  • Over-cap on the live client: agent attempt is BLOCKED over_remaining_cap with zero sandbox wire calls (not even an OAuth fetch), BLOCKED receipt written, ledger chain verifies.
  • Allowed spend on the real wire: the agent's spend creates a real order on the PayPal sandbox; PayPal itself refuses authorize with ORDER_NOT_APPROVED; the pipeline raises ApprovalRequired with 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

  • Live run 2026-10-23: 2 passed against the real sandbox (plus a scripts/sandbox_smoke.py pass the same morning: OAuth OK, order created, status read).
  • Default suite: 406 passed, 3 skipped, plain and python -O (409 collected). With credentials: 408 passed, 1 skipped.
  • demo.py chain 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.

Marcus Richards and others added 2 commits October 23, 2026 00:25
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.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-23T14:32:36.570704Z 15f0e68 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Comment thread tests/test_agent_sandbox_live.py Fixed
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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +106 to +107
with pytest.raises(ApprovalRequired) as exc_info:
tools.attempt_spend(SPEND_CENTS, "widget")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@FetchDoge
FetchDoge merged commit f9f8c9c into main Oct 23, 2026
9 checks passed
@FetchDoge
FetchDoge deleted the m3/sandbox-live-agent branch October 23, 2026 14:34
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.

2 participants