Skip to content

fix: restore cost accounting and responsive session details - #70

Merged
jontsai merged 3 commits into
mainfrom
fix/cost-breakdown-accounting
Oct 4, 2026
Merged

jontsai merged 3 commits into
mainfrom
fix/cost-breakdown-accounting

Conversation

@jonts-ai

@jonts-ai jonts-ai commented Oct 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Fix session-detail stalls: reuse cached session metadata, coalesce bounded asynchronous history requests, and read recent messages through the supported OpenClaw history API.
  • Share live updates across page components and supported same-origin tabs with a SharedWorker, retaining a per-page fallback. This avoids duplicate persistent connections exhausting browser HTTP slots.
  • Read model-aware recorded usage costs through the supported gateway API with asynchronous caching and legacy JSONL fallback. Distinguish measured zero, missing, stale, partial, and provisional data.
  • Label modern reporting as Today (UTC), not rolling 24h. API-equivalent estimates are not subscription charges; remove universal Opus pricing and inferred subscription savings.
  • Populate all cost sections while loading/on failure; cancel superseded requests and prevent late responses overwriting another session or modal.

Verification

  • 219 tests pass, including accounting boundaries, partial pricing, cache coalescing, modern history, shared-stream lifecycle/fallback, and modal errors/races.
  • Build, lint (existing warnings only), formatting, repository checks, and git diff --check pass.
  • Browser verified at root and path-prefixed mounts, with no JavaScript errors.
  • Eight simultaneous dashboard tabs shared one SSE connection. Cost response: 13 ms; session detail: 764 ms cold, 2 ms cached in that run. Final rebuilt preview also passed (2.2 s cold, 4 ms cached).
  • Forced cost HTTP 500 renders an explicit unavailable state, not empty boxes.

Scope / limits

  • History-derived sections describe a bounded recent-message window, not the entire transcript. Session metadata totals are not replaced with that partial window.
  • Recorded estimates may remain provisional while OpenClaw refreshes its own usage cache. Missing prices are not silently treated as zero.
  • Unsupported SharedWorker environments share one stream per page only.
  • Existing optional Jobs API failure is separate and unchanged.
  • Preview only; no merge or live deployment.

Co-authored-by: Jonathan Tsai jontsai@users.noreply.github.com

Co-authored-by: Jonathan Tsai <jontsai@users.noreply.github.com>
@jonts-ai
jonts-ai force-pushed the fix/cost-breakdown-accounting branch from eaa26ba to 0cb3bb0 Compare October 4, 2026 12:03
jonts-ai and others added 2 commits October 4, 2026 11:10
Co-authored-by: Jonathan Tsai <jontsai@users.noreply.github.com>
Co-authored-by: Jonathan Tsai <jontsai@users.noreply.github.com>

@jontsai jontsai left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

LGTM

@jontsai
jontsai merged commit 19aedf3 into main Oct 4, 2026
4 checks passed
@jontsai
jontsai deleted the fix/cost-breakdown-accounting branch October 4, 2026 23:15
jontsai added a commit that referenced this pull request Oct 5, 2026
## Summary
- Builds on the pending standalone core/Spacesuit extension host,
preserving merged #70 session/cost/shared-stream and i18n fixes.
- Adds a provider-independent Projects board with workflow columns,
native tracker status, delivery health, owners, explicit
agent/session/dependency links, filters and source freshness.
- Adds authenticated GET-only bounded snapshot loading with per-source
isolation, profile/agent validation, stale retention across restart, and
no tracker requests in core monitoring.
- Preserves English/Chinese localization; standalone no-source mode
remains functional.

## Validation
- 269 tests pass; build, lint (zero errors; existing warnings),
formatting and repository checks pass.
- Browser: root/prefix URLs, desktop/mobile, filters, raw-text safety,
language switching, retained failures and empty/error distinction.
- Eight tabs: one shared live stream, one initial project request per
tab, no per-card requests.
- Actual Spacesuit Linear/Jira fixture imports render as separate
projects; actual server GET 200 / POST 405 verified.

## Scope and review
Read-only first slice. The preview uses synthetic data. Live Linear/Jira
synchronization is NOT configured. Asana/GitHub adapters, tracker
writes, interactive knowledge queries and rich project drill-down are
future slices. No deployment.

This branch includes the original feat/spacesuit-extension-host
implementation; review this combined branch instead of creating a
duplicate PR from that older head. Companion: jontsai/openclaw-spacesuit
branch feat/project-tracker-adapters.

Co-authored-by: Jonathan Tsai <jontsai@users.noreply.github.com>

---------

Co-authored-by: jonts-ai <324354193+jonts-ai@users.noreply.github.com>
Co-authored-by: Jonathan Tsai <jontsai@users.noreply.github.com>
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.

2 participants