GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — feat: add Zero model registry by gnanam1990 · Pull Request #9 · Twigpine/zero Conversation
Collaborator
SummaryAdds the first Gnanam-owned M1 runtime module from the balanced WorkSplit PRD: a Zero-branded model registry that downstream This PR intentionally keeps the scope to the model registry contract only. It does not introduce provider resolution/factory behavior, Anthropic/Gemini streaming adapters, config changes, or TUI wiring, so it can land before the next Gnanam provider-runtime slices. What Changed
PRD AlignmentThis implements the first Gnanam M1 dependency from
Pricing / Model SourcesPricing and model metadata were checked against official provider docs on 2026-06-02:
ValidationLocal checks run successfully:
Review Notes
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsAdd a Zero-branded model registry with provider metadata, aliases, capabilities, context limits, pricing source metadata, and cost helpers. Cover registry lookup, filters, reasoning effort metadata, deprecated-model handling, tiered pricing, and cost formatting with Bun tests.
Collaborator
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Vasanthdev2004
approved these changes
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Approve — clean model registry foundation. Validated tsc clean and 59/59 tests passing; build failure reproduces on origin/main and is not introduced here.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Collaborator
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
anandh8x
requested changes
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Code Review: PR #9 —
|
| 'high', | ||
| ] as const satisfies readonly ZeroReasoningEffort[]; | ||
|
|
||
| export const ZERO_DEFAULT_MODEL_ID = 'gpt-5.4'; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Blocking — speculative default model.
ZERO_DEFAULT_MODEL_ID = 'gpt-5.4' points to a model that is not publicly released as of sourceLastVerified: 2026-06-02. The test at tests/zero-model-registry.test.ts:66 hard-codes this default, so the rest of the system is now anchored to a phantom model.
If gpt-5.4 is a private beta you have access to, gate it behind a feature flag and add a note. Otherwise default to a verified stable model (e.g., gpt-4.1 or claude-sonnet-4).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| export const ZERO_MODEL_REGISTRY = [ | ||
| { | ||
| id: 'gpt-5.5', |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Blocking — speculative OpenAI models as ground truth.
gpt-5.5, gpt-5.4, gpt-5.4-mini, and gpt-5.4-nano are not in PRICING_SOURCE.openai as of the verification date. The provider factory and /model command will look these up by id and silently dispatch to whatever string this registry hands out.
Ask: Either remove these entries, or split the file into registry.active.ts (only models with public API access today) and registry.preview.ts (clearly marked, gated behind an experimental flag) so downstream code can refuse to dispatch on them. Same applies to the Anthropic and Google speculative entries below.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| apiModel: 'gpt-5.5', | ||
| provider: 'openai', | ||
| status: 'active', | ||
| aliases: ['openai:gpt-5.5', 'gpt-5.5-latest', 'gpt-latest'], |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Blocking — misleading alias.
gpt-latest on gpt-5.5 is a time-bomb: once a newer gpt-* ships, anything resolving gpt-latest will silently keep pointing at gpt-5.5 forever. Remove *-latest aliases and document that aliases are stable and never auto-redirect.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| apiModel: 'gpt-5.4-mini', | ||
| provider: 'openai', | ||
| status: 'active', | ||
| aliases: ['openai:gpt-5.4-mini', 'gpt-5-mini'], |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Blocking — misleading alias.
gpt-5-mini aliasing to gpt-5.4-mini is a false promise: if a real gpt-5-mini is ever released, lookups for gpt-5-mini will silently keep resolving to gpt-5.4-mini. Same for gpt-5-nano → gpt-5.4-nano on line 161. Drop these aliases.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| description: 'Deprecated OpenAI model retained for config migration and history display.', | ||
| }, | ||
| { | ||
| id: 'claude-opus-4.8', |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Blocking — speculative Anthropic models.
claude-opus-4.8, claude-sonnet-4.6, and claude-haiku-4.5 are not publicly released. PRICING_SOURCE.anthropic does not list them. The claude-haiku-4-5-20251001 apiModel also implies a snapshot date that does not exist.
Ask: Remove or quarantine behind a preview flag, same as the OpenAI comment above.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| provider: 'openai', | ||
| status: 'active', | ||
| aliases: ['openai:gpt-4.1'], | ||
| context: { contextWindow: 1_047_576, maxOutputTokens: 32_768 }, |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Important — likely wrong max output.
gpt-4.1 maxOutputTokens: 32_768 — published GPT-4.1 max output is 16,384. Verify against https://platform.openai.com/docs/pricing/ and fix.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| provider: 'anthropic', | ||
| status: 'active', | ||
| aliases: ['anthropic:claude-haiku-4.5', 'haiku-4.5'], | ||
| context: { contextWindow: 200_000, maxOutputTokens: 64_000 }, |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Important — likely wrong max output.
claude-haiku-4.5 maxOutputTokens: 64_000 — published Haiku-class max output is 8,192. If this is a speculative model and the number is also speculative, the notes field on ZeroModelPricing should call that out.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| const models = listZeroModels(); | ||
| expect(models.length).toBeGreaterThanOrEqual(10); | ||
| expect(models.some((model) => model.status === 'deprecated')).toBe(false); | ||
| expect(listZeroModels({ includeDeprecated: true }).some( |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Important — default-exclude path is untested.
This only asserts that gpt-4-turbo exists when includeDeprecated: true. There is no test that listZeroModels() (default, no args) excludes it. Add one — it's a one-liner and protects the public surface.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| export function getZeroModel(modelOrAlias: string): ZeroModelDefinition | undefined { | ||
| const modelId = resolveZeroModelId(modelOrAlias); | ||
| if (!modelId) return undefined; | ||
| return modelsById.get(normalizeModelKey(modelId)); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Suggestion — redundant normalization.
modelsById.get(normalizeModelKey(modelId)) — resolveZeroModelId already returns a canonical id that was inserted via normalizeModelKey in the bootstrap loop, so the second normalize is defensive but adds noise. Either drop it or add a one-line comment explaining why the canonical id may still need normalization.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| return rate; | ||
| } | ||
|
|
||
| function nonNegativeInteger(value: number, label: string): number { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Suggestion — nonNegativeInteger rejects valid floats.
Number.isInteger rejects 1234.0 even though that's a legitimate streaming token count. Consider Math.floor semantics instead, or document that callers must pre-round. The current test only uses integers, so this is a silent breaking change for any provider that emits float counts.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Remove speculative model entries and unstable latest-style aliases from the Zero model registry. Use verified public model metadata, default to gpt-4.1, document stable alias semantics, and tighten cached-token cost handling. Expand tests for deprecated filtering, alias stability, provider mismatch errors, direct model cost inputs, unsupported cache pricing, and invalid cost formatting.
|
@anandh8x requested changes addressed in bfc9bff.\n\nSummary:\n- Removed speculative/non-public registry entries and phantom default model.\n- Changed Zero default model to verified public |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
feat: add Zero model registry (commit bfc9bff9)Thanks for the thorough response. Diff is -228/+121 on registry.ts, +38/-13 on cost.ts, +4/-0 on types.ts, +60/-17 on tests. Net cleanup of ~91 lines. All three blocking issues are resolved, and the registry is now a defensible ground-truth catalog.
Blocking
gpt-4.1, gpt-4.1-mini, gpt-4.1-nano, gpt-4o, gpt-4o-mini, gpt-4-turbo (deprecated), claude-opus-4.1, claude-opus-4, claude-sonnet-4.5, claude-sonnet-4, claude-haiku-4.5, claude-haiku-3.5, gemini-2.5-pro, gemini-2.5-flash, gemini-2.5-flash-lite. ZERO_DEFAULT_MODEL_ID is now gpt-4.1 (registry.ts:29). Spot-checked every line against published docs — all correct.gpt-latest, gpt-5-mini, gpt-5-nano, gemini-2.5-pro-latest are gone, and ZeroModelDefinition.aliases now has an explicit contract: "Stable aliases only; aliases must never auto-redirect to a future model." (types.ts:58). The negative test at tests/zero-model-registry.test.ts:57-61 locks that contract in.cost.ts:34-46 now treats cachedInputTokens as 0 when the model exposes no cachedInputPerMillion, and cost.ts:118-123 returns undefined rather than falling back to inputRate. Test at tests/zero-model-registry.test.ts:132-143 covers the regression.Important
cost.ts:78-102 now sorts bounded tiers and uses an explicit loop with a throw if no tier covers. The invariant is also documented on ZeroModelPricingTier.upToInputTokens ("omit only on the final fallback tier").claudeReasoningEfforts → standardReasoningEfforts (registry.ts:23-27) and applied uniformly. The inline Gemini-3.1-flash-lite array is gone with the model itself.gpt-4.1 max output is now 16,384 (line 39), claude-haiku-4.5 is 8,192 (line 246). The 1,050,000-context oddities are gone with the speculative entries.tests/zero-model-registry.test.ts:24-27 now asserts both the default-excludes and includeDeprecated: true-includes paths for gpt-4-turbo.Suggestions
requireZeroModel (line 398), assertZeroModelProvider (line 434), calculateZeroModelCost (lines 12-19), and on id / apiModel / aliases / upToInputTokens in types.ts.ZeroModelDefinition object input, fully-cached input, alias stability, deprecated filtering.nonNegativeInteger accepts floats via Math.floor (cost.ts:139-143); the new haiku-3.5 test exercises 2_000.9 → 2_000.normalizeModelKey in getZeroModel removed (registry.ts:395).I hand-verified the cost math on the new test cases:
gpt-4.1 1M input / 100k cached / 500k output → 1.8 + 0.05 + 4.0 = 5.85 ✓gpt-4.1-mini 1M / 1M cached / 0 output → input 0, cached 0.1, total 0.1 ✓haiku-3.5 2_000.9 prompt / 1_000.1 completion → 0.0016 + 0.004 = 0.0056 ✓gpt-4-turbo 1k input / 1k cached / 1k output → cache dropped, input 0.01, output 0.03 ✓gemini-2.5-pro tier boundary at 200k → tier 1 = 1.25, tier 2 = 2.5 ✓claude-haiku-4.5 / claude-sonnet-4.5 IDs use dots while their apiModels (claude-haiku-4-5-20251001, claude-sonnet-4-5-20250929) use dashes. The new JSDoc on id ("Version dots are kept when the provider markets the model that way") reads as defensive but the displayName in the Anthropic docs uses dots ("Claude Haiku 4.5") and the apiModel uses dashes. The current state is consistent with that split — call it intentional, but worth a one-line follow-up: either rename IDs to claude-haiku-4-5 for symmetry or add a displayName-based rule to the JSDoc.ZeroModelPricingTier.note still write-only. Populated at registry.ts:298, 303 (and notes[] on ZeroModelPricing is populated for every Anthropic model with the cache-rate caveat) but never surfaced on ZeroModelCostBreakdown. Either expose on the breakdown or drop. Nit.listZeroModelsByProvider / listZeroModelsByCapability re-filter per call. Still there, still fine at 14 models. Skip.notes: ['cachedInputPerMillion models Claude cache hit and refresh pricing.'] is repeated on all six Anthropic models. Worth hoisting to the registry level (or to ZeroModelCapability = 'prompt-cache') once you wire the cost tracking to actually surface notes — otherwise it's documentation in disguise.claude-opus-4.1 id is 4.1 not 4-1. Are we committing to the dot convention for new entries, or is each new entry a fresh argument? Worth pinning in types.ts JSDoc so the next contributor doesn't relitigate it.Approve. All blocking issues from the previous review are resolved, the important items are fixed or have a documented contract, and the test coverage is now strong enough to catch regressions on the items that were broken. The remaining items are nits and a follow-up tracking issue, not blockers for the M1 dependency.
Nice cleanup.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| description: 'Anthropic stable Sonnet model for provider compatibility.', | ||
| }, | ||
| { | ||
| id: 'claude-haiku-4.5', |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Nit — ID/apiModel separator. claude-haiku-4.5 (id, dot) vs claude-haiku-4-5-20251001 (apiModel, dashes) — and same for claude-sonnet-4.5 / claude-sonnet-4-5-20250929 at line 196. The new JSDoc on id is a useful contract, but the reason claude-haiku-4.5 uses a dot is that Anthropic's display name uses a dot, not because the API model does. Either rename the IDs to claude-haiku-4-5 / claude-sonnet-4-5 for symmetry with the apiModel, or tighten the JSDoc to call out that the dot is from the display name. Not blocking — calling it out so the next contributor knows which convention to apply.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| outputPerMillion: 75, | ||
| source: PRICING_SOURCE.anthropic, | ||
| sourceLastVerified: SOURCE_LAST_VERIFIED, | ||
| notes: ['cachedInputPerMillion models Claude cache hit and refresh pricing.'], |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Nit — repeated notes. notes: ['cachedInputPerMillion models Claude cache hit and refresh pricing.'] is duplicated on every Anthropic model (lines 167, 189, 211, 233, 255, 277). When the cost breakdown is wired to surface pricingTier.note or pricing.notes, this duplication will be a maintenance smell. Consider hoisting the cache-pricing caveat to a constant next to PRICING_SOURCE (const ANTHROPIC_CACHE_NOTE = ...) and referencing it on each entry, or attaching the note to the 'prompt-cache' capability itself.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| } | ||
|
|
||
| const fallbackTier = pricing.tiers.find( | ||
| (tier) => tier.upToInputTokens === undefined |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Suggestion — throw path is untested. selectZeroPricingTier now throws "No Zero model pricing tier covers ${inputTokens} input tokens" when no tier covers the input (line 98). All current models either have an unbounded tier or no tiers at all, so this branch is unreachable today, but it's a useful safety net. One-line test:
expect(() => calculateZeroModelCost({ ...requireZeroModel('gpt-4.1'), pricing: { ...requireZeroModel('gpt-4.1').pricing, tiers: [{ inputPerMillion: 1, outputPerMillion: 2, upToInputTokens: 100 }] } }, { inputTokens: 101 }) ).toThrow('No Zero model pricing tier covers');
Or just add it when the next tier-using model is added.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| } | ||
|
|
||
| export interface ZeroModelPricingTier { | ||
| /** Inclusive input-token ceiling for this tier; omit only on the final fallback tier. */ |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Suggestion — the upToInputTokens invariant is now in two places. The JSDoc here ("omit only on the final fallback tier") and the runtime check in selectZeroPricingTier (cost.ts:97-99) both encode the same invariant. If you add a module-load validator that asserts at most one unbounded tier exists and that the input-rate coverage chain is total, you can drop the JSDoc and let the error speak for itself. Minor — current state is fine.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I found a couple of model-metadata issues that should be corrected before this registry becomes the source of truth for downstream routing, budgeting, and cost tracking.
[P2] Add Gemini cached-input pricing to the tiered entries
src/zero-model-registry/registry.ts:293
Gemini 2.5 Pro has published context-caching prices for both <=200k and >200k prompt tiers, but the tier objects only include input/output rates. Because calculateZeroModelCost treats cachedInputTokens as zero whenever the selected tier has no cachedInputPerMillion, any Gemini Pro usage event with cached tokens is charged as fully uncached input. The same cached-pricing metadata also needs a source-doc pass for Flash-Lite: this entry uses 0.025, while the current Gemini pricing page lists the text/image/video cache rate as 0.01. Please add the tier-specific cache rates and cover a cached Gemini Pro/Flash-Lite cost case so this does not silently drift again.
[P2] Correct GPT-4.1 max output metadata
src/zero-model-registry/registry.ts:39
The registry marks gpt-4.1 as maxOutputTokens: 16_384, but the current OpenAI model page for GPT-4.1 lists a 32,768-token max output. Since this registry is intended to drive context budgets and model selection, downstream consumers would unnecessarily cap GPT-4.1 output below the provider limit. Please update the metadata and add an assertion for the published value instead of only checking that the number is positive.
[P2] Avoid making every provider/gateway addition a source edit
src/zero-model-registry/types.ts:1
The new registry hard-codes the supported provider ids in the ZeroModelProvider union and stores all model/provider metadata in TypeScript source. That means adding a new first-class gateway or provider later is not just a catalog/data change: it requires editing shared source types, registry entries, tests, and any downstream provider/runtime branches that consume this union. This is exactly the kind of maintenance path that will make gateway support drift over time, especially once OpenRouter/OpenGateway/Groq/Ollama-style entries need provider-specific credentials, discovery, auth headers, or transport overrides. Please either keep this module explicitly scoped to first-party model metadata, or move provider/gateway definitions to a data-backed descriptor/catalog surface so adding a gateway does not require coordinated edits across core source each time.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Addresses the correctness findings from the PR review. self-report (#1): drop behavior-describing phrases ("fall back to", "placeholder value", bare "best guess", "as a fallback", "without proper") that also match legitimate final answers; keep first-person/uncertainty admissions only, since these are matched without a context guard. self-report (#5): scan every occurrence of each inability stem so an early success-negation ("could not find any examples") no longer masks a later genuine admission with the same stem ("could not implement it"). continuation cue (#6): require a trailing colon AND an action lead-in on the final clause; stop flagging recommendations, plain summary colons, and sign-offs. Still catches the mid-line "...Let me check the config:". gate order (#8): check the self-report admission BEFORE pending-plan, so an admitted-impossible task downgrades immediately with the accurate reason instead of burning continue-nudges. pending plan (#3): treat a pending/in_progress update_plan item as a NUDGE-only weak signal -- it no longer forces INCOMPLETE on its own (a completed run that left stale plan bookkeeping is trusted). Only a continuation cue or a self-report admission finalizes INCOMPLETE. max-turns (#4): a run cut off at the MaxTurns ceiling now finalizes INCOMPLETE under the gate instead of being reported as success. exec json/cron (#2, #7): for -o json, emit the terminal done with exit 4 on an incomplete run (final() pre-emits a success done:0 for json that would otherwise mask it); emit an error event -- not just a warning -- so the cron failure extractor can recover the reason. Deferred (noted on the PR): acceptance-only-when-mutated (#9, cost) and reusing tools.normalizePlanStatus (#10, would widen scope to internal/tools). Tests: add TestContinuationCueMatching and TestMaxTurnsCutoffIsIncompleteUnderGate, extend TestSelfReportedIncompletionMatching with the #1/#5 cases, and replace the in_progress=>incomplete test with TestPendingPlanAloneDoesNotForceIncomplete. make build / go vet / make lint / go test ./... -race all green.
… on no-tool-call / self-reported-incomplete turns) (#325) * fix(agent): don't end a run as success on a no-tool-call turn mid-task A turn that produced text but no tool call was always accepted as the final answer, so the loop reported success even when the model stopped mid-task (e.g. ended on "...Let me check the SSH configuration:" with plan steps still pending). Add an opt-in completion gate (Options.RequireCompletionSignal): when a turn has no tool call and work clearly remains -- pending update_plan items, or the message ends on a continuation cue -- re-prompt the model to continue instead of finalizing. Bounded by maxContinueNudges and still by MaxTurns/the deadline; once the budget is spent the run finalizes as INCOMPLETE (Result.Incomplete) rather than success. Default off, so the interactive path is byte-identical. Genuine single-turn completions (no pending plan, no cue) still finalize as success. Covered by internal/agent/completion_gate_test.go. * feat(exec): report stalled headless runs as INCOMPLETE (exit 4) Enable the agent completion gate for headless exec (RequireCompletionSignal) and map Result.Incomplete to run_end status "incomplete" with a new exit code 4, so a run that stalled mid-task (model stopped without a tool call while work remained, continue budget exhausted) is no longer reported as success. Interactive callers are unaffected. * fix(agent): downgrade self-reported non-completion; advisory task-grounded acceptance Reduce -- not eliminate -- false-success on headless runs. Two DETERMINISTIC, unit-tested gates (with the plan gate from the prior commit): (a) self-report downgrade: if the final message admits the model guessed or could not meet the objective, finalize INCOMPLETE (exit 4), never success. Inability is matched by first-person STEMS generalized over verb/tense ("I cannot/can't/could not/am unable to/do not have/unable to ...") plus guess/fallback/uncertainty phrases, with a guard so success-y negations ("could not find any issues", "cannot reproduce") are not misread. (b7bc0b8's plan gate already forces INCOMPLETE on pending/in_progress update_plan items at termination.) (b) task-grounded acceptance is ADVISORY, not a guarantee. When --self-correct is on it demands one bounded acceptance pass that re-derives the task's stated criterion and runs a concrete check, discouraging three false-success patterns (well-formed==correct, existing-tests-pass==objective-met, result==baseline-it-was-told-to-beat). But it is a prompt: a model that ignores it and confidently claims "PASS, all requirements met" still slips, because ZERO has no general oracle to verify correctness against a task's hidden criterion. Empirically (TB-2, qwen3-coder:480b) this reliably catches admissions and incomplete plans and REDUCES false-success, but a confident false PASS on a model-ceiling task is a residual, fundamental gap -- not a tuning miss. Default off (RequireCompletionSignal); interactive callers are byte-identical. Covered by internal/agent/{acceptance_gate_test.go,completion_gate_test.go}. * feat(exec): surface the INCOMPLETE reason in run_end and logs When a headless run finalizes as INCOMPLETE, include Result.IncompleteReason in the session error event and a stderr warning so an honestly-incomplete run (e.g. "the final message admits the objective was not met") is debuggable rather than an opaque exit 4. * fix(agent): harden completion gate per PR review Addresses the correctness findings from the PR review. self-report (#1): drop behavior-describing phrases ("fall back to", "placeholder value", bare "best guess", "as a fallback", "without proper") that also match legitimate final answers; keep first-person/uncertainty admissions only, since these are matched without a context guard. self-report (#5): scan every occurrence of each inability stem so an early success-negation ("could not find any examples") no longer masks a later genuine admission with the same stem ("could not implement it"). continuation cue (#6): require a trailing colon AND an action lead-in on the final clause; stop flagging recommendations, plain summary colons, and sign-offs. Still catches the mid-line "...Let me check the config:". gate order (#8): check the self-report admission BEFORE pending-plan, so an admitted-impossible task downgrades immediately with the accurate reason instead of burning continue-nudges. pending plan (#3): treat a pending/in_progress update_plan item as a NUDGE-only weak signal -- it no longer forces INCOMPLETE on its own (a completed run that left stale plan bookkeeping is trusted). Only a continuation cue or a self-report admission finalizes INCOMPLETE. max-turns (#4): a run cut off at the MaxTurns ceiling now finalizes INCOMPLETE under the gate instead of being reported as success. exec json/cron (#2, #7): for -o json, emit the terminal done with exit 4 on an incomplete run (final() pre-emits a success done:0 for json that would otherwise mask it); emit an error event -- not just a warning -- so the cron failure extractor can recover the reason. Deferred (noted on the PR): acceptance-only-when-mutated (#9, cost) and reusing tools.normalizePlanStatus (#10, would widen scope to internal/tools). Tests: add TestContinuationCueMatching and TestMaxTurnsCutoffIsIncompleteUnderGate, extend TestSelfReportedIncompletionMatching with the #1/#5 cases, and replace the in_progress=>incomplete test with TestPendingPlanAloneDoesNotForceIncomplete. make build / go vet / make lint / go test ./... -race all green.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.