Skip to content

Commit ee385f5

Browse files
committed
refactor(copilot): drop unused steering billing metadata
1 parent 455b1f8 commit ee385f5

3 files changed

Lines changed: 3 additions & 12 deletions

File tree

apps/sim/app/api/billing/update-cost/route.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -229,11 +229,9 @@ async function updateCostInner(req: NextRequest, span: Span): Promise<NextRespon
229229

230230
let billingAttribution = suppliedBillingAttribution
231231
/**
232-
* Old Go creates its random idempotency key after admission and returns no
233-
* protocol or payer envelope. The markerless legacy-v0 path therefore
234-
* re-resolves a locally known workspace at callback time. This mutable
235-
* compatibility semantic is intentionally unreachable from modern
236-
* attributed-v1/direct-v1 callbacks.
232+
* Local self-hosted markerless callbacks have no immutable payer envelope,
233+
* so they re-resolve a locally known workspace at callback time. Hosted
234+
* attributed-v1/direct-v1 callbacks can never reach this mutable path.
237235
*/
238236
if (isMarkerlessLegacy && workspaceId) {
239237
billingAttribution =

apps/sim/app/api/copilot/chat/steer/route.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ export const POST = withRouteHandler((request: NextRequest) =>
7373
chatId,
7474
steeringId,
7575
content,
76-
workspaceId: run?.workspaceId ?? undefined,
7776
})
7877
queued = result.queued
7978
goStatus = result.status

apps/sim/lib/copilot/request/session/steer.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
import type { Context } from '@opentelemetry/api'
2-
import {
3-
COPILOT_BILLING_PROTOCOL,
4-
COPILOT_BILLING_PROTOCOL_HEADER,
5-
} from '@/lib/billing/core/billing-attribution'
62
import { TraceAttr } from '@/lib/copilot/generated/trace-attributes-v1'
73
import { fetchGo } from '@/lib/copilot/request/go/fetch'
84
import { getMothershipBaseURL, getMothershipSourceEnvHeaders } from '@/lib/copilot/server/agent-url'
@@ -25,7 +21,6 @@ export async function requestStreamSteering(params: {
2521
chatId: string
2622
steeringId: string
2723
content: string
28-
workspaceId?: string
2924
timeoutMs?: number
3025
otelContext?: Context
3126
}): Promise<{ queued: boolean; status: number }> {
@@ -41,7 +36,6 @@ export async function requestStreamSteering(params: {
4136

4237
const headers: Record<string, string> = {
4338
'Content-Type': 'application/json',
44-
[COPILOT_BILLING_PROTOCOL_HEADER]: COPILOT_BILLING_PROTOCOL.legacy,
4539
}
4640
if (env.COPILOT_API_KEY) {
4741
headers['x-api-key'] = env.COPILOT_API_KEY

0 commit comments

Comments
 (0)