Skip to content

[Improve] Attribute inference usage to active workflows - #2252

Draft
roomote-roomote[bot] wants to merge 1 commit into
developfrom
improve/attribute-workflow-usage-375v9zvt2mylj
Draft

[Improve] Attribute inference usage to active workflows#2252
roomote-roomote[bot] wants to merge 1 commit into
developfrom
improve/attribute-workflow-usage-375v9zvt2mylj

Conversation

@roomote-roomote

Copy link
Copy Markdown
Contributor

​Opened on behalf of @mrubens. View the task or mention @roomote-roomote for follow-up asks.

What changed

  • Annotate finalized primary-session inference usage with the active packaged workflow skill.
  • Persist the workflow identifier in the existing inference usage details without changing the accounting schema or customer-visible transcript.
  • Keep child and subagent inference usage untagged so it is not attributed to the parent workflow.

Why this change was made

Roomote already records per-message token usage and cost and separately tracks the active packaged workflow, but the two signals could not be correlated. Associating them makes workflow context and cost measurable using the existing accounting path.

Impact

There is no customer-facing behavior change. Operators can compare inference usage by workflow and identify expensive workflow context without a new cost calculator, database migration, or analytics subsystem.

@roomote-community

roomote-community Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

1 issue outstanding. See task

  • Preserve active workflow attribution after a harness reconnect (apps/worker/src/sandbox-server/lib/harnesses/opencode-server/harness.ts:5454).

Reviewed 2b62319

message.info,
tokenUsage,
options?.agentType,
message.info.sessionID === this.sessionId

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ReconnectableHarness creates a fresh OpenCodeServerHarness with only initialSessionId after any disconnect, while activeWorkflowSkill is initialized to null and is not rehydrated. Once a workflow task reconnects, subsequent primary-session messages take this branch with no workflow skill and are persisted with details: null, losing the attribution this change is meant to preserve. Carry the active workflow through reconnect (or recover it from the session) and cover that path.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant