mirror of
https://github.com/larksuite/cli.git
synced 2026-07-12 12:33:52 +08:00
The instance/ListAgents branch of `agent list <scheme>` makes a real online call but skipped the two gates every other online verb runs via resolveSpec + preflightScopesForRef: the user|bot identity whitelist and the all-or-nothing scope preflight. A future network-backed provider would get a worse contract on list than on send/task/context — a scope-lacking user hit a raw platform error instead of a clean missing_scope (exit 3), and an out-of-whitelist identity was never rejected. - preflightScopesForRef is split into a scheme-keyed core (preflightScopesForScheme) plus a thin ref wrapper; ref-addressed callers are unchanged. - The online list branch now calls f.CheckIdentity and preflightScopesForScheme (the full RequiredScopes, same all-or-nothing rule as the other verbs) before ListAgents. Enumeration is treated as a real API verb, not a special case. - `agent list` registers --as so the enumeration identity can be chosen (the offline no-scheme provider listing ignores it). Catalog providers (offline enumeration) are unaffected. Tests cover the scope preflight (missing_scope, ListAgents not called), the identity whitelist, and the --as flag registration.