Skip to content

ModelOutputThunk should not be a CBlock #269

Closed

Description

@nrfulton

Justification: Python pattern matching is based on order not specificity, so the following code never makes it into the second branch.

match span:
  case CBlock():
    handle cblocks generically
  case ModelOutputThunk():
    handle mots in particular
  case Component():
    handle more complex stuff

This is a footgun. The easiest solution is to simply remove mot from the cblock type hierarchy. There are no disadvanatges: anywhere we expect a cblock or a mot we should be explicit about that with a union type anyways, because mot.value is semantically different from cb.value

Activity

  1. self-assigned this
    on Jan 7, 2026
  2. jakelorocco commented on May 12, 2026

    @jakelorocco
    Contributor

    @nrfulton, this is probably yet another design question that we should revisit.

  3. jakelorocco commented on May 12, 2026

    @jakelorocco
    Contributor

    Do we still want to make this change @nrfulton?

  4. added
    area/stdlib
    area/telemetry
    enhancement
    needs-design
    area/component
    on May 20, 2026
  5. AngeloDanducci commented on Jun 17, 2026

    @AngeloDanducci
    Contributor

    cc @nrfulton @jakelorocco did we reach a definite design choice on this?

  6. jakelorocco commented on Jun 22, 2026

    @jakelorocco
    Contributor

    Discussed: We should make ModelOutputThunks a separate class.

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

Metadata

Metadata

Labels

area/componentarea/stdlibarea/telemetryenhancementneeds-design

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions