Skip to content

fix: chat stream stuck thinking, dashboard UX improvements, directory…#127

Merged
jsyqrt merged 7 commits into
mainfrom
bugfix/chat-stream-bugfix
May 12, 2026
Merged

fix: chat stream stuck thinking, dashboard UX improvements, directory…#127
jsyqrt merged 7 commits into
mainfrom
bugfix/chat-stream-bugfix

Conversation

@jsyqrt
Copy link
Copy Markdown
Contributor

@jsyqrt jsyqrt commented May 11, 2026

… deliverable preview

  • Fix SSE stream: resolve messageStream promise on 'done' event instead of waiting for HTTP close
  • Fix send() race condition: guard cleanup so interrupted stream doesn't kill new stream's state
  • Add safety net: force-end streaming if agent becomes idle while sending is still true
  • Dashboard: blocked tasks use amber (waiting state), only stuck-blocked shown as red alert
  • Dashboard: agent ranking uses activity-weighted health score (idle agents ranked lower)
  • Dashboard: "working now" metric uses neutral blue color instead of red-green threshold
  • Deliverable preview: directories show file listing with navigation, render-or-reveal per file

jsyqrt and others added 7 commits May 11, 2026 22:10
… deliverable preview

- Fix SSE stream: resolve messageStream promise on 'done' event instead of waiting for HTTP close
- Fix send() race condition: guard cleanup so interrupted stream doesn't kill new stream's state
- Add safety net: force-end streaming if agent becomes idle while sending is still true
- Dashboard: blocked tasks use amber (waiting state), only stuck-blocked shown as red alert
- Dashboard: agent ranking uses activity-weighted health score (idle agents ranked lower)
- Dashboard: "working now" metric uses neutral blue color instead of red-green threshold
- Deliverable preview: directories show file listing with navigation, render-or-reveal per file

Co-authored-by: Cursor <cursoragent@cursor.com>
Existing loop detectors require exact hash matching on args/results,
missing cases where an agent calls the same tool consecutively with
varying arguments (e.g., different shell commands to debug a failing
server). The new detector catches single-tool dominance patterns
regardless of argument or result variation.

Co-authored-by: Cursor <cursoragent@cursor.com>
… to in_progress

When acceptTask transitions a task to completed, it cancels pending HITL
approvals which resolve with approved=false, causing notifyHumanReviewer's
callback to erroneously set the task back to in_progress. Guard the callback
by checking the task is still in review status before acting.

Co-authored-by: Cursor <cursoragent@cursor.com>
- Sidebar defaults to minimum draggable width, shows text labels when collapsed
- Replace bell icon with sidebar nav notification button that opens floating panel
- Remove redundant collapse button from sidebar header
- Widen team chat list with Feishu-inspired dark mode styling
- Unify chat list item brightness: selected state only changes background

Co-authored-by: Cursor <cursoragent@cursor.com>
…eliable billing data

- Fix top card label: "LLM Token (本月)" → "累计" since data is all-time, not monthly
- Remove Math.max mixing of all-time agent metrics with monthly billing in /api/usage
- Remove broken period-specific cost/token display from Cost Overview (billing service
  is in-memory only, lost on restart, showing ~1.6M vs actual 241M tokens)
- Hide Storage card when 0 B (billing never records storage events)
- Use actual model catalog pricing (e.g. Claude Opus $5/$25, DeepSeek $0.14/$0.28)
  instead of hardcoded $3/$15 estimate across AgentMetricsCollector, report-service,
  and all 8 emitAudit call sites in agent.ts
- Add getModelCost() to LLMRouter, track per-call cost with input/output token split
- Surface costToday through API and frontend for accurate daily cost display
- Backward-compatible: falls back to old estimate for pre-migration persisted metrics

Co-authored-by: Cursor <cursoragent@cursor.com>
@jsyqrt jsyqrt merged commit de48a3e into main May 12, 2026
1 check passed
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