GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: treat released=0 as unknown date so config-declared models stay visible by 0xalydev · Pull Request #49616 · anomalyco/opencode

Conversation

@0xalydev

@0xalydev 0xalydev commented Sep 17, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Issue for this PR

Closes #49605

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

The server uses time.released = 0 as a sentinel for models that have no known release date (config-declared models, locally-hosted models, providers not yet in the registry). normalizeProviderList() was converting that 0 into new Date(0).toISOString().slice(0, 10) which produces "1970-01-01".

The visibility filter in models.tsx has an escape hatch: if a model's release date is not a valid date (!date?.isValid), it returns true (visible). The problem is "1970-01-01" is a perfectly valid Luxon DateTime, so the escape hatch never fires. The model is then checked against the "latest set" (released within the past 6 months) and fails, landing in the hidden branch. Result: any model a user explicitly declares in opencode.jsonc is invisible in the model picker unless they manually override it in settings.

The fix is one line: when model.time.released === 0, set release_date to undefined instead of converting the epoch timestamp. That makes date?.isValid falsy, the escape hatch fires, and the model is shown. The field type is already string | undefined (optional) in the SDK, so no type changes are needed.

How did you verify your code works?

Added a new test case to the existing normalizeProviderList suite in utils.test.ts asserting that an active model with time.released === 0 produces release_date: undefined. The existing test for the deprecated gpt-old model already uses released: 0 and asserts that model is filtered entirely, confirming the deprecated-model path is unchanged. Logic traced through models.tsx visible() function to confirm undefined hits the !date?.isValid escape hatch.

Screenshots / recordings

Not a UI change - model visibility is a state filter, not a visual component.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@0xalydev
fix: treat released=0 as unknown date to keep config models visible
9185309
Models declared in opencode.jsonc that the server does not have a
release date for are emitted with time.released=0. Mapping 0 to
new Date(0) produces the ISO string "1970-01-01", which is a valid
Luxon DateTime. The visibility filter in models.tsx only shows models
whose release date is within the past 6 months or whose date is
invalid/unknown. With a valid 1970-01-01 date the model fell into the
"hidden by default" branch and never appeared in the model picker,
even though the user had explicitly configured it.

Fix: when model.time.released === 0, set release_date to undefined
instead. That makes date?.isValid falsy in the visibility guard,
which triggers the "return true" escape hatch and keeps the model
visible.

Also adds a dedicated regression test to normalizeProviderList covering
active models with released=0 asserting release_date is undefined.

Fixes: anomalyco#49605
@0xalydev
0xalydev requested review from Brendonovich and Hona as code owners September 17, 2026 20:01
@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels Sep 17, 2026
@github-actions

github-actions Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@yingliang-zhang

yingliang-zhang commented Sep 22, 2026

Copy link
Copy Markdown

Independently confirmed the bug on a real affected setup (desktop 2.0.14, macOS, custom OpenAI-compatible provider with 11 config-declared models): GET /api/model returns all 11 with enabled: true and time.released: 0, yet a fresh client shows none of them — only previously-selected models keep their persisted show override.

Verified this branch locally:

  • bun test in packages/app passes, including the new released=0 case.
  • Feeding real /api/provider + /api/model responses from a dev server through the actual normalizeProviderList() and the visible() decision chain from models.tsx (fresh client, no stored preferences): 11/11 models visible with this branch, 0/11 on dev with the same data.

One blocker — bun run typecheck in packages/app fails on this branch:

src/context/global-sync/utils.ts(134,7): error TS2322: Type 'string | undefined' is not assignable to type 'string'.

The optional release_date?: string lives on the config-side models type (types.gen.ts ~L1768), but the assignment target in normalizeProviderList uses the catalog model entry type where release_date: string is required (~L2110). CI doesn't run typecheck, which is probably why it slipped through. Using "" instead of undefined would keep the one-line fix type-safe — DateTime.fromISO("") is also invalid, so the !date.isValid escape hatch in models.tsx still fires.

Two nits while reviewing: utils.test.ts starts with a UTF-8 BOM before the first import, and the trailing newline at EOF was dropped.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@0xalydev
fix(app): use empty string for unreleased model release_date to satis…
d1dfb41
…fy typecheck
@0xalydev

0xalydev commented Sep 22, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Author

Thank you @yingliang-zhang for the careful review and catching the typecheck blocker.

Updated in commit d1dfb41:

  1. Switched release_date fallback from undefined to "" (empty string) when model.time.released === 0, satisfying the required string type on the catalog model entry while preserving the invalid-date escape hatch in models.tsx.
  2. Updated the regression test in utils.test.ts to assert release_date is "".
  3. Stripped the UTF-8 BOM and restored the trailing newline at EOF in utils.test.ts.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@thdxr

thdxr commented Oct 10, 2026

Copy link
Copy Markdown
Member

This branch has been upgraded to V2. We're no longer taking PRs for V1. If you think this is still relevant, please port it over and open it for V2.

— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@thdxr thdxr closed this Oct 10, 2026
This was referenced Oct 28, 2026
web: config-declared models are hidden by default — released:0 is coerced to "1970-01-01" and fails the client visibility window #49605
Closed
bug(app): custom models without release dates are hidden in V2 #60479
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@Hona Hona Awaiting requested review from Hona
@Brendonovich Brendonovich Awaiting requested review from Brendonovich

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

web: config-declared models are hidden by default — released:0 is coerced to "1970-01-01" and fails the client visibility window

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@0xalydev @yingliang-zhang @thdxr
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.