You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dispatched a third clean-state subagent with an iteration-heavy scenario
(Amira's Kopi Junction support agent with escalation rules). The subagent
confirmed v1.5.1/1.5.2 fixes work as advertised — `--patch` iteration took
just 2 commands to go from V1 wrong to V2 correct — and flagged 3 new
actionable friction points addressed here.
Fixes:
1. (F1) Model preflight on agent create/update
Previously `{"model":"not-a-real-model"}` saved successfully and only
blew up at next `agent run`. Now fails fast with a structured error +
hint listing known models. Plausible-but-unknown (`vendor/name` shape)
models warn to stderr but proceed — so brand-new models work between
CLI releases.
2. (F2) Status-hint enrichment on API errors
401 → "Run af whoami / af login --api-key"
403 → "Check workspace/project or API key scopes"
404 → "Run the matching `list` command to see available IDs"
409 → "Fetch current state and reconcile before retrying"
422 → "Check details.payload for field-level errors"
429 → "Rate limited; back off"
Every API error in --json output now carries an actionable `hint`.
3. (F3) Null-strip visibility
`af agent update` emits a stderr [info] line listing which null-valued
fields got auto-stripped — closes the footgun where bots thought they
cleared a field but the server never saw null. Silenced under --json
(keeps stdout clean for pipes).
Tests: 385 pass (+7 from new utils-models.test.ts), same 14 skipped + 10
todo. Full regression: no behavior change on the green path.
Quote from the round-3 subagent after using v1.5.2: "--patch made
iteration feel like editing code, not re-creating a resource. Consistent
schema: discriminators on every JSON response make scripting trivial.
This is the right trajectory."
"Model preflight on `af agent create/update` — invalid model strings (typos, missing slash) fail fast BEFORE the agent gets created with a broken config. Unknown-but-plausible models warn but proceed (so new models work between CLI releases)",
21
+
"Structured error hints on 401/403/404/409/422/429 — every common HTTP failure now carries an actionable `hint` in --json output pointing at the right recovery command (`af whoami`, `af agent list`, fetch-and-reconcile, etc.)",
22
+
"`af agent update` emits a stderr `[info]` line naming which null-valued fields got auto-stripped. Closes the footgun where bots thought they'd cleared a field but the server never saw null. Silenced with --json (keeps stdout clean for piping)",
23
+
],
24
+
for_ai: [
25
+
"If you're iterating on an agent's system prompt with `--patch`, don't also clear optional fields by sending null — the CLI strips them and the stderr info line tells you which ones were dropped",
26
+
"When a command fails, check the `hint` field in the error envelope before retrying — 404s point you at the matching `list` command, 422s point you at `details.payload` for field-level errors",
27
+
"Pass only models from `af bootstrap --json > models[]` — typos fail at validation time, not at next `agent run`. If you're trying a brand-new model and hit a warning, you can proceed (CLI is conservative — warns but doesn't block)",
suggestion: `Model "${trimmed}" is not in the CLI's known list. If this is a new model, proceed — but double-check the spelling. Known: ${KNOWN_MODELS.join(", ")}`,
58
+
};
59
+
}
60
+
return{
61
+
valid: false,
62
+
known: false,
63
+
suggestion: `Model "${trimmed}" has an invalid shape (expected "vendor/model-name"). Available: ${KNOWN_MODELS.join(", ")}`,
0 commit comments