Skip to content

Give decision API rejections a stable error code #114

Open

Description

@leehack

Decision API rejections are plain Errors with no status code, so llamadart has to classify them by message text (leehack/llamadart#620, webgpu_decision.dart _bridgeException): "Load the decision head again", "No model loaded", "Bridge has been disposed", "was cancelled", "during active generation" and "decision encoder context". Rewording any of these silently changes which exception llamadart throws.

Proposal: before the decision API's first published assets, attach a stable code to rejected errors: the core status (for example -4) or a string such as 'head-lost', 'no-model', 'disposed', 'cancelled', 'busy', 'context'. Document the codes in docs/api.md next to apiVersion 1.

Activity

  1. added
    enhancementNew feature or request
    priority:P2Important improvement or regression; schedule next
    on Sep 23, 2026
  2. leehack commented on Sep 24, 2026

    @leehack
    OwnerAuthor

    Status: decision API 1 shipped without codes in v0.1.47, and llamadart main now pins it. leehack/llamadart#620 merged, so _bridgeException in lib/src/backends/webgpu/webgpu_decision.dart classifies rejections by message text in production. Adding a code is still additive. Keep the current messages unchanged until llamadart switches to the codes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestpriority:P2Important improvement or regression; schedule next

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions