@phnx-labs/agents-cli 1.23.19 → 1.23.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/README.md +1 -1
- package/dist/commands/exec.js +1 -1
- package/dist/lib/accounting/account-pool-collect.d.ts +2 -2
- package/dist/lib/accounting/account-pool-collect.js +4 -4
- package/dist/lib/accounting/account-pool.d.ts +1 -1
- package/dist/lib/accounting/account-pool.js +3 -1
- package/dist/lib/session/recovery.d.ts +1 -1
- package/dist/lib/session/recovery.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.23.20
|
|
4
|
+
|
|
5
|
+
- **Balanced and available rotation never pick an API-key account (owner decision 2026-10-12).**
|
|
6
|
+
A provider account whose credential is an `api-key` or `bearer-token` (OpenRouter,
|
|
7
|
+
an Anthropic or OpenAI API key, LiteLLM, a proxy) bills per token, yet it joined the
|
|
8
|
+
automatic pool beside subscription logins (RUSH-3182). For example, `agents run claude`
|
|
9
|
+
could land on `openrouter-primary` and run Claude through OpenRouter at API prices.
|
|
10
|
+
Only a `setup-token` provider account now joins the pool, beside native logins.
|
|
11
|
+
An api-key account still runs when named: `--account <name>`, a binding, or
|
|
12
|
+
`agents accounts default`. A harness whose only accounts are API keys gets no
|
|
13
|
+
automatic pick from them.
|
|
14
|
+
Source: `cli/src/lib/accounting/account-pool.ts`, `cli/src/lib/accounting/account-pool.test.ts`,
|
|
15
|
+
`cli/src/lib/accounting/account-pool-collect.test.ts`.
|
|
16
|
+
|
|
3
17
|
## 1.23.19
|
|
4
18
|
|
|
5
19
|
- **`agents projects prs <project> --json` carries `mergeable` and `mergeableState` (PHNX-4326).**
|
package/README.md
CHANGED
|
@@ -213,7 +213,7 @@ agents run claude@ # pick the device for this run
|
|
|
213
213
|
agents run claude#@ # pick the account, then the device
|
|
214
214
|
```
|
|
215
215
|
|
|
216
|
-
`--strategy balanced` spreads work across available versions of the same agent -- useful when you have multiple accounts and want to avoid burning through one. When a Claude run reports a session limit, agents-cli records the stated reset time, shows `session-limited` in `agents view`, and excludes that account until the reset. When every account is rate-limited, the run exits nonzero naming each excluded account and the earliest window reset (use `--strategy pinned` to force a rate-limited default) -- it never launches into an exhausted account. A logged-out default is never forced: unpinned dispatch picks a signed-in version on the execution device instead of dying on a credential-less default home.
|
|
216
|
+
`--strategy balanced` spreads work across available versions of the same agent -- useful when you have multiple accounts and want to avoid burning through one. It picks only subscription logins and setup-tokens; an API-key account (OpenRouter, an Anthropic or OpenAI key) bills per token, so it runs only when you name it with `--account`. When a Claude run reports a session limit, agents-cli records the stated reset time, shows `session-limited` in `agents view`, and excludes that account until the reset. When every account is rate-limited, the run exits nonzero naming each excluded account and the earliest window reset (use `--strategy pinned` to force a rate-limited default) -- it never launches into an exhausted account. A logged-out default is never forced: unpinned dispatch picks a signed-in version on the execution device instead of dying on a credential-less default home.
|
|
217
217
|
|
|
218
218
|
### Don't care which harness? `agents run auto`
|
|
219
219
|
|
package/dist/commands/exec.js
CHANGED
|
@@ -605,7 +605,7 @@ ${formatModeSupportTable().split('\n').map((line) => ` ${line}`).join('\n
|
|
|
605
605
|
given. --cloud is mutually exclusive with --device/--lease and with
|
|
606
606
|
local-run flags (--loop, --resume, --secrets, --terminal, …).
|
|
607
607
|
|
|
608
|
-
Resume: --resume <id> resolves full IDs locally first, then fleet-wide, and recovers on the source device with its cwd/mode. Resume preserves the conversation account and uses the installed binary; starting a new conversation from archived context requires an explicit choice. With auto as the agent (agents run auto --resume <id>) the harness is inferred from the session; a named agent must match it. A bare --resume opens the session picker for the last 30 days of this project (up to 200 rows); --all widens it to every directory and lifts the 30d window, --teams adds team-spawned sessions, --since <time> and -n/--limit <n> set the window and row cap. These four only filter the picker: they are refused next to --resume <id> or without --resume.
|
|
608
|
+
Resume: --resume <id> resolves full IDs locally first, then fleet-wide, and recovers on the source device with its cwd/mode. Resume preserves the conversation account (an API-key account only when named with --account; otherwise it continues on a subscription account) and uses the installed binary; starting a new conversation from archived context requires an explicit choice. With auto as the agent (agents run auto --resume <id>) the harness is inferred from the session; a named agent must match it. A bare --resume opens the session picker for the last 30 days of this project (up to 200 rows); --all widens it to every directory and lifts the 30d window, --teams adds team-spawned sessions, --since <time> and -n/--limit <n> set the window and row cap. These four only filter the picker: they are refused next to --resume <id> or without --resume.
|
|
609
609
|
|
|
610
610
|
Passthrough: everything after -- is forwarded verbatim to the underlying agent CLI.
|
|
611
611
|
agents run kimi -- --plan --some-native-flag value
|
|
@@ -6,5 +6,5 @@ export interface RunCandidateInputs {
|
|
|
6
6
|
records: RegistryAccountRecord[];
|
|
7
7
|
runVersion: string | undefined;
|
|
8
8
|
}
|
|
9
|
-
export declare function foldRegistryCandidates(agent: AgentId, inputs: RunCandidateInputs): RotateCandidate[];
|
|
10
|
-
export declare function collectRunCandidatesForRun(agent: AgentId): Promise<RotateCandidate[]>;
|
|
9
|
+
export declare function foldRegistryCandidates(agent: AgentId, inputs: RunCandidateInputs, includeKeyed?: boolean): RotateCandidate[];
|
|
10
|
+
export declare function collectRunCandidatesForRun(agent: AgentId, includeKeyed?: boolean): Promise<RotateCandidate[]>;
|
|
@@ -15,12 +15,12 @@ function localRegistryRecords() {
|
|
|
15
15
|
throw err;
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
export function foldRegistryCandidates(agent, inputs) {
|
|
18
|
+
export function foldRegistryCandidates(agent, inputs, includeKeyed = false) {
|
|
19
19
|
const { native, records, runVersion } = inputs;
|
|
20
20
|
if (!runVersion)
|
|
21
21
|
return native;
|
|
22
22
|
const seen = new Set(native.filter((c) => c.accountKey).map((c) => c.accountKey));
|
|
23
|
-
const extra = registryPoolCandidates(records, agent)
|
|
23
|
+
const extra = registryPoolCandidates(records, agent, includeKeyed)
|
|
24
24
|
.filter((r) => !seen.has(r.accountKey))
|
|
25
25
|
.map((r) => ({
|
|
26
26
|
agent,
|
|
@@ -42,8 +42,8 @@ export function foldRegistryCandidates(agent, inputs) {
|
|
|
42
42
|
}));
|
|
43
43
|
return [...native, ...extra];
|
|
44
44
|
}
|
|
45
|
-
export async function collectRunCandidatesForRun(agent) {
|
|
45
|
+
export async function collectRunCandidatesForRun(agent, includeKeyed = false) {
|
|
46
46
|
const native = await collectRunCandidates(agent);
|
|
47
47
|
const runVersion = getGlobalDefault(agent) ?? listInstalledVersions(agent)[0];
|
|
48
|
-
return foldRegistryCandidates(agent, { native, records: localRegistryRecords(), runVersion });
|
|
48
|
+
return foldRegistryCandidates(agent, { native, records: localRegistryRecords(), runVersion }, includeKeyed);
|
|
49
49
|
}
|
|
@@ -16,5 +16,5 @@ interface RegistryAccountInput {
|
|
|
16
16
|
auth: AccountAuthKind;
|
|
17
17
|
secretPresent: boolean;
|
|
18
18
|
}
|
|
19
|
-
export declare function registryPoolCandidates(records: RegistryAccountRecord[], agent: AgentId): RegistryAccountInput[];
|
|
19
|
+
export declare function registryPoolCandidates(records: RegistryAccountRecord[], agent: AgentId, includeKeyed?: boolean): RegistryAccountInput[];
|
|
20
20
|
export {};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { providerAuthenticatesHarness } from '../account-provider-registry.js';
|
|
2
|
-
export function registryPoolCandidates(records, agent) {
|
|
2
|
+
export function registryPoolCandidates(records, agent, includeKeyed = false) {
|
|
3
3
|
const out = [];
|
|
4
4
|
for (const r of records) {
|
|
5
|
+
if (r.auth !== 'setup-token' && !includeKeyed)
|
|
6
|
+
continue;
|
|
5
7
|
if (!providerAuthenticatesHarness(r.provider, r.auth, agent))
|
|
6
8
|
continue;
|
|
7
9
|
out.push({
|
|
@@ -51,6 +51,6 @@ export declare function inspectNativeResumeSession(session: SessionMeta, version
|
|
|
51
51
|
export declare function resolveSessionRecoveryFromCandidates(session: SessionMeta, candidates: RotateCandidate[], supportsNative?: (agent: AgentId, version?: string) => boolean, nativeInspection?: NativeResumeInspection, options?: SessionRecoverySelection): SessionRecoveryTarget;
|
|
52
52
|
export declare function sessionTranscriptReadable(session: SessionMeta): boolean;
|
|
53
53
|
export declare function assertRecoverableTranscript(session: SessionMeta): void;
|
|
54
|
-
export declare function resolveSessionRecovery(session: SessionMeta, collect?: (agent: AgentId) => Promise<RotateCandidate[]>, options?: SessionRecoverySelection): Promise<SessionRecoveryTarget>;
|
|
54
|
+
export declare function resolveSessionRecovery(session: SessionMeta, collect?: (agent: AgentId, includeKeyed?: boolean) => Promise<RotateCandidate[]>, options?: SessionRecoverySelection): Promise<SessionRecoveryTarget>;
|
|
55
55
|
export declare function sessionRecoveryRunArgs(session: Pick<SessionMeta, 'id'>): string[];
|
|
56
56
|
export {};
|
|
@@ -331,7 +331,7 @@ export async function resolveSessionRecovery(session, collect = collectRunCandid
|
|
|
331
331
|
const installation = resolveManagedInstallation(agent);
|
|
332
332
|
if (!installation)
|
|
333
333
|
throw new SessionRecoveryError(`No managed ${agent} installation is available. Install it with: agents add ${agent}`);
|
|
334
|
-
return resolveSessionRecoveryFromCandidates(session, await collect(agent), undefined, undefined, {
|
|
334
|
+
return resolveSessionRecoveryFromCandidates(session, await collect(agent, Boolean(options.account?.trim())), undefined, undefined, {
|
|
335
335
|
...options, executableVersion: installation.label,
|
|
336
336
|
});
|
|
337
337
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phnx-labs/agents-cli",
|
|
3
|
-
"version": "1.23.
|
|
3
|
+
"version": "1.23.20",
|
|
4
4
|
"description": "One CLI for all your AI coding agents - versions, config, cloud dispatch, sessions, and teams (now with first-class Grok Build CLI support)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|