Skip to content

feat(remote_signer): emit model_id in create_signed_ticket Kafka events#3947

Draft
eliteprox wants to merge 8 commits into
ja/live-runnerfrom
feat/add-model-id-signer-kafka
Draft

feat(remote_signer): emit model_id in create_signed_ticket Kafka events#3947
eliteprox wants to merge 8 commits into
ja/live-runnerfrom
feat/add-model-id-signer-kafka

Conversation

@eliteprox

@eliteprox eliteprox commented Jun 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add Capabilities.ModelIDForCapability() to derive a model ID from per-capability constraints
  • Include model_id in the remote signer create_signed_ticket Kafka event for LV2V sessions

Fixes OpenMeter/billing events showing model_id: "unknown" when the gateway already sends model constraints in the capabilities protobuf on each /generate-live-payment request.

Test plan

  • go test -tags=mainnet,experimental ./core/ -run TestModelIDForCapability
  • CI docker build
  • Deploy signer image and verify Kafka create_signed_ticket events include real model_id for LV2V

@coderabbitai

coderabbitai Bot commented Jun 13, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d5cadebc-15d3-43d5-a4a2-72df666644cd

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/add-model-id-signer-kafka

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added go Pull requests that update Go code labels Jun 13, 2026
@eliteprox

Copy link
Copy Markdown
Collaborator Author

This will go in RemotePaymentState eventually, but pushed a draft since this works for now

@linear-code

linear-code Bot commented Jun 25, 2026

Copy link
Copy Markdown

ENG-148

@eliteprox
eliteprox force-pushed the feat/add-model-id-signer-kafka branch from f533245 to 6bad183 Compare June 25, 2026 21:16
@eliteprox
eliteprox changed the base branch from master to ja/live-runner June 25, 2026 21:16
eliteprox added a commit that referenced this pull request Jun 25, 2026
eliteprox added 5 commits July 8, 2026 15:40
…ng tests

- Implemented the ModelIDForCapability method in the Capabilities struct to return the constrained model ID for a given capability, ensuring deterministic results when multiple models are present.
- Added unit tests for ModelIDForCapability to cover various scenarios, including nil receivers, no constraints, single constrained models, and handling of ambiguous model cases.
- Updated the remote signer to include the model ID in the event payload for LiveVideoToVideo capabilities.
…al resolution

- Modified the test for ModelIDForCapability to reflect that multiple models resolve to the lexicographically first ID instead of returning an empty string.
- Adjusted the expected output in the test case to return "comfyui" for the Capability_LiveVideoToVideo capability.
- Updated the payment processing logic to include an optional `AuthID` in the `RemotePaymentState` and `authResponse` structures.
- Modified the `doPaymentWithStateAndAuthID` function to accept and set the `AuthID` from the request header or callback response.
- Added tests to verify the correct handling of `AuthID` in various scenarios, including fallback behavior and error handling when the `AuthID` changes unexpectedly.
- Ensured that the `AuthID` is included in the response payload for better tracking and debugging.
Shared livepeerci/build:cache caused PR Docker tags (pr-3947,
feat-add-model-id-signer-kafka) to point at an older livepeer binary while
metadata listed the PR head SHA. Skip registry cache on pull_request builds
and pass GIT_REVISION to bust the compile layer.
eliteprox added 3 commits July 8, 2026 16:09
…ined model ID resolution

- Introduced `CapabilityToPipeline` function to convert capabilities to their corresponding pipeline slugs, returning an empty string for unknown capabilities.
- Implemented `ConstrainedPipelineModelID` method to return a deterministic pipeline/model ID pair based on per-capability constraints, ensuring lexicographical resolution when multiple capabilities are present.
- Added unit tests for both new functions to validate their behavior under various scenarios, including handling of nil capabilities and multiple constraints.
- Updated the remote signer to utilize the new constrained pipeline logic for improved payment processing.
@eliteprox

Copy link
Copy Markdown
Collaborator Author

Clearinghouse is tracking the related work as non-blocking side-tracks (label go-livepeer) so this PR does not gate Deliverable 2:

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

Labels

go Pull requests that update Go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Model-ID usage attribution - add model_id to create_signed_ticket + sign RemotePaymentState per-model

1 participant