Files
npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7andWill Pfleger f944bf6061 fix(agents): pass-3/4 findings — baked tier, definition alias policy, one metadata contract
Thufir's review identified three IMPORTANT defects (all live display/spawn
divergences — the same class LP-EFFORT-VISIBILITY targets):

1. Baked native effort deleted at spawn while the UI reported it as inherited.
   Rust: apply_effort_bridge now carries baked_env as the lowest-precedence tier
   (native-key only, no legacy alias). TS: resolveBakedEffort extracted as a
   shared helper in bakedEnvHelpers.ts; AgentConfigFields (global/onboarding)
   now routes through it so baked xhigh→max and invalid minimal→absent on both
   display and spawn. Pins: resolveBakedEffort_{xhigh_normalizes_to_max,
   invalid_minimal_returns_null}.

2. Definition-tier alias-policy inversion: spawn passed allow_legacy_alias=false
   correctly at global but incorrectly at definition. The bool param is renamed
   to allow_legacy_alias with an explicit doc table; global and definition cannot
   silently diverge again.

3. Metadata contract duplicated across Rust and TS: EffortNormalization.aliases
   serialized through AcpRuntimeCatalogEntry.effort_aliases; normalizeEffortValue
   fallback alias table removed — absent effortAliases means no aliases (not
   Goose aliases). effortAliases threaded through all production call sites
   (AgentDefinitionDialog, AgentInstanceEditDialog, HarnessNativeEffortFields).
   useAgentDialogDefaults gains a runtime param so callers pass one object
   instead of three; AgentDefinitionDialog/AgentInstanceEditDialog use it.
   ALL_KNOWN_EFFORT_KEYS static constant removed; allKnownEffortKeys() derives
   from runtime declarations in both Rust and TS. Fixtures in agentConfigCore
   and buzzAgentConfig tests updated to carry effortAliases; non-Goose
   ultra→max pin proves normalization comes from the descriptor, not a table.

Rust ALL_KNOWN_EFFORT_KEYS → all_known_effort_keys() (derived from
KNOWN_ACP_RUNTIMES); apply_effort_bridge: #[allow(clippy::too_many_arguments)]
added for the 8th param.

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
2026-08-13 12:26:10 -04:00
..