fix(tools): getAccounts defaults to limit=100; getActor validates the UUID up front#69
fix(tools): getAccounts defaults to limit=100; getActor validates the UUID up front#69sVIKs wants to merge 1 commit into
Conversation
… UUID up front
Two dead-end traps found by a live audit of real assistant sessions:
getAccounts: the backend default page is ~30 rows and the response has
no has-more marker. On an actor with 20+ system accounts (Reactions,
edges, Default, ...) the accounts created last — exactly the ones the
caller just made and wants to see — fall off the first page, and the
result reads as "the account was never created / the transaction did
not work". This was the single most expensive support mystery in our
project logs. The tool now requests limit=100 (the backend max) when
the caller does not page explicitly; explicit paging is untouched. The
Summary documents the backend default, the fact-only `total`, and the
pair-access ghost (createAccount on a pair you cannot see succeeds but
the account never appears in any listing — see createAccountPair).
getActor: the backend answers 403 Access Denied for any malformed or
truncated actorId, which reads as a permissions problem when it is a
typo. A Resolve hook now validates the 36-char UUID form before the
request and fails fast with the real reason plus the getActorByRef
alternative.
Verified live against mw (fresh binary over stdio JSON-RPC):
- actor with 61 accounts: unpaged getAccounts returns all 40 visible
fact rows (the old binary returned the backend 30-row page)
- getActor("6bf39ec9"): instant format error instead of 403
Tests: scenario tests for the default/explicit limit and the UUID
rejection/pass-through; the bound-arg test now binds a UUID-shaped id
(real binds carry actor UUIDs). Full suite + vet green; discovery
artifacts regenerated with no drift.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)
AI ReviewAdds two Checklist
Issues found[error] U4 — Wrong base branch Fix: change the PR base to [warning] U1 — Commit subject line is 83 characters (limit: 70) The conventional-commit convention caps subject lines at 70 characters; this is 83. Consider splitting into two commits (one per tool) or shortening the description, e.g.: (70 chars exactly) [warning] U6 — UUID guard is inconsistently applied This review was generated automatically. A human maintainer should still make the merge decision. |
Two dead-end traps, found by a live audit of real assistant sessions
1. getAccounts silently hides the accounts you just created
The backend's default page is ~30 rows and the response carries no has-more marker. Every actor already owns 20+ system accounts (Reactions ×10, edges, Default, …), so the accounts created last — exactly the ones the caller wants to see — fall off the first page. The result reads as «the account was never created / the transaction didn't work». In our project logs this was the single most expensive support mystery (days of debugging «empty accounts» during a data-migration engine build).
Fix: a
Resolvehook requestslimit=100(the backend max) when the caller does not page explicitly; explicit paging is untouched. The Summary now documents the backend default, thattotal:truecounts only fact-type accounts, and the pair-access ghost:createAccounton a(nameId, currencyId)pair you cannot see returns 200 andalready existon retry, yet the account never appears in any listing — pointing atcreateAccountPair.Verified live (mw, fresh binary over stdio JSON-RPC): actor with 61 accounts — unpaged
getAccountsreturns all 40 visible fact rows; the previous binary returned the backend's 30-row page.2. getActor answers 403 for a typo
The backend returns
403 Access Deniedfor any malformed/truncatedactorId(e.g.6bf39ec9), which reads as a permissions problem when it is a copy-paste accident.Fix: a
Resolvehook validates the 36-char UUID form before the request and fails fast:Verified live: instant format error instead of the 403.
Tests
/actors/<uuid>op_bound_testnow binds a UUID-shaped id (real binds carry actor UUIDs)go test ./...+go vetgreen;make discoveryregenerated with no drift🤖 Generated with Claude Code