Skip to content

fix(token-id-capture): ignore auxiliary model-server requests when tracking completeness #2678

Closed

Description

@ananthsub

Problem

_CaptureMiddleware.__call__ marks every rollout-prefixed request whose path is absent from _OBSERVED_PATHS as an incomplete token capture. Hermes sends auxiliary model-server requests such as /v1/models through the same prefixed endpoint before generation. Those requests cannot produce training tokens, but they still create blank incomplete markers and force the completed rollout to be masked.

The generation call itself is captured correctly. Terminal attribution can resolve its model call, but capture_incomplete overrides that result during finalization.

Expected behavior

Only an unobserved request that can perform generation should mark the rollout incomplete. Known auxiliary discovery and health requests should pass through without affecting capture completeness.

Suggested test

Add middleware coverage showing that a rollout-prefixed /v1/models request does not call mark_incomplete, while an unsupported generation path continues to fail closed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions