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 — Malformed `cost.tiers` still crashes the turn (TypeError, not DecimalError) · Issue #43254 · anomalyco/opencode

Malformed cost.tiers still crashes the turn (TypeError, not DecimalError) #43254

New issue
Copy link
New issue
Copy link
Closed as not planned
Closed as not planned
Malformed cost.tiers still crashes the turn (TypeError, not DecimalError)#43254
Copy link
Assignees
jlongster

Description

@macurandb
macurandb
opened on Aug 18, 2026
Issue body actions

Description

#43248 guarded the cost operands, but the tier selection right above them is still unguarded:

input.model.cost?.tiers
  ?.filter((item) => item.tier.type === "context" && contextTokens > item.tier.size)

cost() in provider/provider.ts copies tier: item.tier straight from the models.dev / plugin payload with no guard of its own — unlike input/output/cache. So a malformed tiers still throws from getUsage and takes the turn with it. Same symptom as #43098 (fatal under opencode acp), different error:

cost.tiers error on dev
[{ input, output, cache }] (no tier key) TypeError: undefined is not an object (evaluating 'item.tier.type')
[null] TypeError: null is not an object (evaluating 'item.tier')
{} (not an array) TypeError: input.model.cost?.tiers?.filter is not a function

Note a non-numeric tier.size must not be coerced to 0 when fixing this — that would make the tier match every context instead of none.

OpenCode version

Reproduces on current dev (9b0dd36 — i.e. with #43248 already in).

Steps to reproduce

Call getUsage with a model whose cost.tiers is any of the three shapes above. Three failing unit tests in the PR that follows.

Operating System

macOS

Terminal

VS Code integrated terminal

Activity

  1. github-actions
    assigned
    jlongster
    on Aug 18, 2026
  2. github-actions commented on Oct 18, 2026

    @github-actions
    github-actionsBot
    on Oct 18, 2026 – with GitHub Actions
    Contributor
    More actions

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

  3. github-actions
    closed this as not plannedon Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @jlongster
    jlongster

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    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.