Commit e2fdffd
committed
fix: address review findings across telemetry, consent, branding, and quantum
Telemetry (integration.ts, collector.ts, index.ts):
- Remove process.once SIGTERM/beforeExit handlers that crash outside
Instance context; rely on Instance.state disposal for flush
- Move recordedUserMessages to TelemetryState (cleared per session)
to prevent unbounded Set growth across sessions
- Remove dead assistantToUser map and dead PartUpdated text branch
- Use info.parentID for turn start time lookup instead of fragile
insertion-order heuristic on turnStartTimes map
- Fix exported finalizeTurn() to actually call collector.finalizeTurn()
- Cache consentTier/dataLevel from initialize() to avoid redundant
getConsentStatus() call in startSession()
- Remove duplicate retry/recordRetry export from Telemetry namespace
Consent dialog (dialog-telemetry-consent.tsx, app.tsx):
- Use DialogTelemetryConsent.show() API instead of raw dialog.replace()
to properly wire onResult and onClose callbacks
- Default tier to 'paid' (genuine opt-out) until actual tier detection
is implemented; 'free' forced all users into required telemetry
- Add double-fire guard on handleSelect to prevent duplicate KV writes
- Fix Esc handler: free tier forces accept, paid tier declines
- Fix unsafe 'as boolean' cast on KV value with === true check
- Add consentShown guard to prevent re-show on rebootstrap cycles
- Remove unnecessary spread in <For> component
Branding (apply.ts, schema.ts, brand.json):
- Rewrite non-exclusive models.ts get() replacement to use actual
upstream scope variables (filepath, Bun.file, data macro, refresh)
instead of nonexistent readCache/writeCache/url
- Add match-failure assertions to all regex transforms so upstream
refactors produce loud build errors instead of silent failures
- Remove unused 'default' field from ModelsSchema and brand.json
Quantum (client.ts, tools.ts):
- Add Zod schemas for QuantumDevice, QuantumJob, JobResult with
runtime .parse() validation on all API responses
- Add pricingAvailable flag to CostEstimate; warn when pricing is
unavailable instead of silently returning 0
- Add ctx.ask() permission gate to quantum_cancel_job (destructive op)
- Thread ctx.abort signal through all tool execute -> client calls
- Add 30s default timeout via AbortSignal.timeout on all fetch calls
- Cache resolveAuth() result for 5s to avoid repeated disk reads
- Truncate error response bodies to 500 chars
- Normalize job status with .toUpperCase() for consistent comparison
- Wrap getResult() in try/catch for TOCTOU race after status check
- Fix pricing display from '$' prefix to 'credits' suffix1 parent 51d6d74 commit e2fdffd
File tree
10 files changed
+253
-162
lines changed- branding
- qbraid
- packages/opencode/src
- cli/cmd/tui
- component
- quantum
- telemetry
10 files changed
+253
-162
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
363 | 363 | | |
364 | 364 | | |
365 | 365 | | |
366 | | - | |
| 366 | + | |
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
370 | 370 | | |
371 | 371 | | |
372 | 372 | | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
373 | 377 | | |
374 | 378 | | |
375 | 379 | | |
376 | 380 | | |
377 | 381 | | |
378 | 382 | | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
379 | 388 | | |
380 | | - | |
| 389 | + | |
381 | 390 | | |
382 | 391 | | |
383 | 392 | | |
384 | 393 | | |
385 | 394 | | |
386 | | - | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
387 | 399 | | |
388 | 400 | | |
389 | | - | |
| 401 | + | |
| 402 | + | |
390 | 403 | | |
391 | | - | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
392 | 407 | | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
| 408 | + | |
| 409 | + | |
398 | 410 | | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
| 411 | + | |
| 412 | + | |
404 | 413 | | |
405 | 414 | | |
406 | | - | |
| 415 | + | |
407 | 416 | | |
408 | 417 | | |
409 | 418 | | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
410 | 423 | | |
411 | 424 | | |
412 | 425 | | |
| |||
431 | 444 | | |
432 | 445 | | |
433 | 446 | | |
434 | | - | |
| 447 | + | |
435 | 448 | | |
436 | 449 | | |
437 | 450 | | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
438 | 455 | | |
439 | 456 | | |
440 | 457 | | |
| |||
446 | 463 | | |
447 | 464 | | |
448 | 465 | | |
449 | | - | |
| 466 | + | |
450 | 467 | | |
451 | 468 | | |
452 | 469 | | |
453 | 470 | | |
454 | 471 | | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
455 | 476 | | |
456 | 477 | | |
457 | 478 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | 32 | | |
34 | 33 | | |
35 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
| 49 | + | |
49 | 50 | | |
50 | | - | |
51 | | - | |
52 | 51 | | |
53 | 52 | | |
54 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
277 | 277 | | |
278 | 278 | | |
279 | 279 | | |
| 280 | + | |
280 | 281 | | |
281 | 282 | | |
282 | 283 | | |
283 | 284 | | |
284 | | - | |
| 285 | + | |
| 286 | + | |
285 | 287 | | |
286 | 288 | | |
287 | 289 | | |
288 | 290 | | |
289 | | - | |
290 | | - | |
| 291 | + | |
291 | 292 | | |
292 | 293 | | |
293 | 294 | | |
294 | 295 | | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
300 | 299 | | |
301 | 300 | | |
302 | 301 | | |
| |||
Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
66 | 67 | | |
| 68 | + | |
| 69 | + | |
67 | 70 | | |
68 | 71 | | |
69 | 72 | | |
| |||
97 | 100 | | |
98 | 101 | | |
99 | 102 | | |
100 | | - | |
| 103 | + | |
101 | 104 | | |
102 | 105 | | |
103 | 106 | | |
| |||
131 | 134 | | |
132 | 135 | | |
133 | 136 | | |
134 | | - | |
135 | | - | |
| 137 | + | |
| 138 | + | |
136 | 139 | | |
137 | 140 | | |
138 | 141 | | |
0 commit comments