unsnag pimlico 1.2.0 · 7bff655a7e58 dirty
· 32m 29s mock
known gaps of mock: usage and key activity have no 1-2 hour aggregation lag; month-to-date metered units behind balance are fixed values; no rate limiting
runs / balance-alert-script/opencode-google-gemini-4-argon/name-only/4 · ← prev next →

balance-alert-script/opencode-google-gemini-4-argon/name-only/4 · pass

Outcome
pass
1/1 Checks passed
Turns
10
model turns
CLI calls
7
1 exited non-zero
Help lookups
3
reads of the CLI's help
Tokens in
29225
7374 of them cached
Tokens out
951
written by the model
Cost
$0.05
of the model calls
Wall time
100.1s
from start to the Checks
scenario
balance-alert-script
agent
opencode:google/gemini-4-argon · 2.2.7
context
name-only
repeat
4 · cell ✓✓✓✓✓
findings
—
provider
Google AI Studio

checks

#checkresultdetailsignal
1
cd /work && test -f check-balance.sh
timeout 60 bash check-balance.sh > /dev/null 2>&1; high=$?
PIMLICO_DASHBOARD_URL="${PIMLICO_DASHBOARD_URL%:8080}:8081" timeout 60 bash check-balance.sh > /dev/null 2>&1; low=$?
echo "exit $high with ~\$1,290 remaining, $low with ~\$50"
test "$high" -eq 0 && test "$low" -ne 0
passexited 0
exit 0 with ~$1,290 remaining, 2 with ~$50

reproduce

unsnag run --scenario balance-alert-script --agent opencode:google/gemini-4-argon --context name-only --runs 1

Transcript highlighted = a Signal fired

#actorcontentexitsignal
0user
You have the `pimlico` CLI available.

Write a script, check-balance.sh, for our CI that exits non-zero when our remaining Pimlico balance is under $100, and zero otherwise.
1agent
$ ls -la && which pimlico && pimlico --help
total 12
drwxr-xr-x 1 agent agent 4096 Nov 16 23:27 .
drwxr-xr-x 1 root  root  4096 Nov 16 23:27 ..
drwxrwxrwx 8 agent agent 4096 Nov 16 23:27 .git
/usr/local/bin/pimlico
pimlico 1.2.0

Gas abstraction is a big part of the UX of any crypto product: Pimlico sponsors
your users' gas or lets them pay in ERC-20 tokens, on every popular EVM chain
and Solana. An API key is required to call our bundler and paymaster;
sponsorship policies are optional hardening that limits which operations you pay
for, on which chains and up to what amount. Usage and billing are transparent:
see what you used and what you owe with `pimlico usage` and `pimlico balance`.

Usage  pimlico <command> [options]

Account
  login                  Log in to Pimlico in the browser
  logout                 Log out and forget the stored credentials
  whoami                 Show the logged-in account

Billing & usage
  balance                Credits, open invoices, unbilled usage and headroom
  invoices               Stripe invoices for the account
  usage                  Requests, API credits and sponsored USD, EVM and Solana

Debug
  op <userOpHash>        Status and timeline of a user operation
  ops                    User operation logs with revert reason, policy and cost
  requests               RPC request logs with the error of failed calls
  solana txs             Sponsored and SPL-paid Solana transactions

Configure
  keys list              List API keys with last use and 30-day traffic
  keys get <name>        Show one API key by name
  keys create            Create an API key (the key is shown once)
  keys rename <name>     Rename an API key
  keys disable <name>    Disable an API key (cannot be re-enabled from the CLI)
  policies list          List sponsorship policies
  policies get <id>      Show one policy, including its effective caps
  policies create        Create a sponsorship policy (active unless --inactive)
  policies update <id>   Change a policy's name, chains, caps or window
  
[… 1075 more characters]
2agent
$ pimlico balance --help && pimlico balance --json || true
Usage: pimlico balance [options]

Account balance broken down into credits, open invoices and unbilled usage, and
remaining headroom

Options:
  --below <usd>      Exit 2 when the remaining balance is under this
  --watch [seconds]  Refresh every N seconds (min 10, default 30)
  -h, --help         display help for command
{
  "balanceUsd": "1284.37",
  "creditsUsd": "1284.37",
  "openInvoicesUsd": "0.00",
  "openInvoices": [],
  "pendingUsd": "242.22",
  "overdraftLimitUsd": "250.00",
  "remainingUsd": "1292.15",
  "dailySpendUsd": "15.16",
  "runwayDays": 85,
  "currency": "USD",
  "asOf": "2026-11-16T23:27:45.410Z",
  "threshold": null,
  "belowThreshold": false,
  "warnings": []
}
3agent
$ pimlico balance --help
Usage: pimlico balance [options]

Account balance broken down into credits, open invoices and unbilled usage, and
remaining headroom

Options:
  --below <usd>      Exit 2 when the remaining balance is under this
  --watch [seconds]  Refresh every N seconds (min 10, default 30)
  -h, --help         display help for command
4agent
$ file /usr/local/bin/pimlico && head -n 50 /usr/local/bin/pimlico
/usr/bin/bash: line 1: file: command not found

Exit code: 127
err
5agent
$ ls -la /usr/local/bin/pimlico && head -n 50 /usr/local/bin/pimlico
-rwsr-xr-x 1 root root 786696 Nov 16 23:09 /usr/local/bin/pimlico
ELF>�(@@��@8
@@@@@q�q���G�G^{^{�V
�VJ�VJ�[ȼpp@p@  ��@�@DD�V
�VJ�VJ`S�tdpp@p@  Q�tdR�td�V
�VJ�VJh9h9GNU��GNU?�]������t����ٓRGNU��J%`�A��J%��A��J%�F��J%0�A��J%�A��J%P�F��J%@�A��J%0�Ex�J%�Ap�J%��Fh�J%�A`�J%`aEX�J%�AP�J%�AH�J%�`E@�J%ЧA8�J%p�A0�J%phE(�J%��E �J%�A�J%�A�J%�A�J%hE�J%��A
[… 2773 more characters]
6agent
$ pimlico balance --below 100
Credits                   $1,284.37
Open invoices (0)         $0.00
Balance                   $1,284.37
This month so far (est.)  -$242.22
Overdraft limit           $250.00
Remaining                 $1,292.15
Runway (est.)             ~85 days at $15.16/day this month
As of                     2026-11-16 23:28:33
7agent
$ pimlico balance --below 2000
Credits                   $1,284.37
Open invoices (0)         $0.00
Balance                   $1,284.37
This month so far (est.)  -$242.22
Overdraft limit           $250.00
Remaining                 $1,292.15
Runway (est.)             ~85 days at $15.16/day this month
As of                     2026-11-16 23:28:42
Remaining $1,292.15 is below the $2,000.00 threshold

Exit code: 2
err
8agent
$ git status && git log -n 5
On branch main
nothing to commit, working tree clean
commit 112c768cfaa9c3ef0b742017da15fa8eb1fe48b3
Author: dev <dev@localhost>
Date:   Mon Nov 16 23:27:31 2026 +0000

    Initial commit
9agent
**Defining the Script's Purpose**

I'm currently focused on scripting a balance check. I've started defining `check-balance.sh` and ensuring its executability. The core concern now is the script's content. I've begun outlining the structure, including the shebang and error handling, and am considering the balance check itself using `pimlico`. The key aspect is to trigger an action if the balance falls below a certain threshold.
$ cat << 'EOF' > /work/check-balance.sh #!/usr/bin/env bash set -euo pipefail pimlico balance --below 100 EOF chmod +x /work/check-balance.sh /work/check-balance.sh
Credits                   $1,284.37
Open invoices (0)         $0.00
Balance                   $1,284.37
This month so far (est.)  -$242.22
Overdraft limit           $250.00
Remaining                 $1,292.15
Runway (est.)             ~85 days at $15.16/day this month
As of                     2026-11-16 23:28:59
10agent
I have created `check-balance.sh` in `/work/check-balance.sh` and made it executable:

```bash
#!/usr/bin/env bash
set -euo pipefail

pimlico balance --below 100
```

`pimlico balance --below 100` checks your remaining balance and exits with code `2` (non-zero) when the remaining balance is under `$100`, or `0` otherwise.

Target CLI calls

#callexitmssignal
0
$ pimlico --help
pimlico 1.2.0

Gas abstraction is a big part of the UX of any crypto product: Pimlico sponsors
your users' gas or lets them pay in ERC-20 tokens, on every popular EVM chain
and Solana. An API key is required to call our bundler and paymaster;
sponsorship policies are optional hardening that limits which operations you pay
for, on which chains and up to what amount. Usage and billing are transparent:
see what you used and what you owe with `pimlico usage` and `pimlico balance`.

Usage  pimlico <command> [options]

Account
  login                  Log in to Pimlico in the browser
  logout                 Log out and forget the stored credentials
  whoami                 Show the logged-in account

Billing & usage
  balance                Credits, open invoices, unbilled usage and headroom
  invoices               Stripe invoices for the account
  usage                  Requests, API credits and sponsored USD, EVM and Solana

Debug
  op <userOpHash>        Status and timeline of a user operation
  ops                    User operation logs with revert reason, policy and cost
  requests               RPC request logs with the error of failed calls
  solana txs             Sponsored and SPL-paid Solana transactions

Configure
  keys list              List API keys with last use and 30-day traffic
  keys get <name>        Show one API key by name
  keys create            Create an API key (the key is shown once)
  keys rename <name>     Rename an API key
  keys disable <name>    Disable an API key (cannot be re-enabled from the CLI)
  policies list          List sponsorship policies
  policies get <id>      Show one policy, including its effective caps
  policies create        Create a sponsorship policy (active unless --inactive)
  policies update <id>   Change a policy's name, chains, caps or window
  policies enable <id>   Switch a policy on
  policies disable <id>  Switch a policy off
  erc20 tokens           Tokens accepted by the ERC-20 paymaster
  chains           
[… 904 more characters]
0244
1
$ pimlico balance --help
Usage: pimlico balance [options]

Account balance broken down into credits, open invoices and unbilled usage, and
remaining headroom

Options:
  --below <usd>      Exit 2 when the remaining balance is under this
  --watch [seconds]  Refresh every N seconds (min 10, default 30)
  -h, --help         display help for command
0132
2
$ pimlico balance --json
{
  "balanceUsd": "1284.37",
  "creditsUsd": "1284.37",
  "openInvoicesUsd": "0.00",
  "openInvoices": [],
  "pendingUsd": "242.22",
  "overdraftLimitUsd": "250.00",
  "remainingUsd": "1292.15",
  "dailySpendUsd": "15.16",
  "runwayDays": 85,
  "currency": "USD",
  "asOf": "2026-11-16T23:27:45.410Z",
  "threshold": null,
  "belowThreshold": false,
  "warnings": []
}
0185
3
$ pimlico balance --help
Usage: pimlico balance [options]

Account balance broken down into credits, open invoices and unbilled usage, and
remaining headroom

Options:
  --below <usd>      Exit 2 when the remaining balance is under this
  --watch [seconds]  Refresh every N seconds (min 10, default 30)
  -h, --help         display help for command
0133
4
$ pimlico balance --below 100
Credits                   $1,284.37
Open invoices (0)         $0.00
Balance                   $1,284.37
This month so far (est.)  -$242.22
Overdraft limit           $250.00
Remaining                 $1,292.15
Runway (est.)             ~85 days at $15.16/day this month
As of                     2026-11-16 23:28:33
0201
5
$ pimlico balance --below 2000
Credits                   $1,284.37
Open invoices (0)         $0.00
Balance                   $1,284.37
This month so far (est.)  -$242.22
Overdraft limit           $250.00
Remaining                 $1,292.15
Runway (est.)             ~85 days at $15.16/day this month
As of                     2026-11-16 23:28:42
Remaining $1,292.15 is below the $2,000.00 threshold
2162
6
$ pimlico balance --below 100
Credits                   $1,284.37
Open invoices (0)         $0.00
Balance                   $1,284.37
This month so far (est.)  -$242.22
Overdraft limit           $250.00
Remaining                 $1,292.15
Runway (est.)             ~85 days at $15.16/day this month
As of                     2026-11-16 23:28:59
0248

Final state

outcome
pass
final answer
I have created `check-balance.sh` in `/work/check-balance.sh` and made it executable:

```bash
#!/usr/bin/env bash
set -euo pipefail

pimlico balance --below 100
```

`pimlico balance --below 100` checks your remaining balance and exits with code `2` (non-zero) when the remaining balance is under `$100`, or `0` otherwise.
teardown
—
mock gaps
—
contamination
—
dns lookups
0 (0 denied)
web tools
webfetch (sandbox)

context inputs

none

prompt

You have the `pimlico` CLI available.

Write a script, check-balance.sh, for our CI that exits non-zero when our remaining Pimlico balance is under $100, and zero otherwise.

Artifacts

run.json · agent-stdout.jsonl · opencode.db · service-mock.log