Skip to content

feat: statusline provider usage + session workspace actions SDK - #77089

Closed
Codezilla-jpg wants to merge 8 commits into
NousResearch:mainfrom
Codezilla-jpg:feat/statusline-workspaces-full
Closed

feat: statusline provider usage + session workspace actions SDK#77089
Codezilla-jpg wants to merge 8 commits into
NousResearch:mainfrom
Codezilla-jpg:feat/statusline-workspaces-full

Conversation

@Codezilla-jpg

Copy link
Copy Markdown

Summary

Adds the core/gateway/desktop plumbing needed by the external Desktop plugin hermes-statusline-workspaces:

  • JSON-safe, credential-free serialization for provider account usage snapshots
  • JSON-safe live rate-limit state serialization + OpenAI-compatible reset duration parsing
  • Persistent session.workspace.set RPC (durable session id, optional profile, busy-session guard)
  • Desktop SDK contribution area session.actions plus curated host helpers:
    • host.selectWorkspaceDirectory
    • host.setSessionWorkspace
  • SDK docs updated accordingly

Companion plugin

Notes / follow-ups

  • Gateway RPC usage.providers is still a planned follow-up for a single combined account+rate-limit payload.
  • Rate-limit overflow/edge-case hardening can still be tightened further.

Test plan

  • tests/agent/test_account_usage.py (serializer + account suites)
  • tests/agent/test_rate_limit_tracker.py
  • tests/tui_gateway/test_session_workspace_set.py (+ adjacent session/cwd suites)
  • Desktop: session-actions-menu.test.tsx, typecheck on touched surfaces
  • CI full matrix

@teknium1 teknium1 left a comment

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.

Thanks for the focused SDK and session-workspace groundwork. Two integration gaps need resolution before the companion plugin can work end to end.

Problems

  • apps/desktop/src/sdk/index.ts:128-131 routes to a profile gateway but does not send profile in the RPC params. The handler selects its database through _profile_db(params) (tui_gateway/server.py:1209-1218), so app-global remote mode can target the launch profile rather than the row's profile.
  • agent/account_usage.py:57-81 and agent/rate_limit_tracker.py:106-122 add serializers, but no usage.providers handler is added. The linked plugin calls host.request('usage.providers', ...), so its provider status path remains unavailable.

Suggested changes

  • Forward profile in the workspace RPC params and add a cross-profile durable-id test.
  • Add and exercise the combined provider-usage RPC, or split that unfinished statusline integration from this PR.

This is an automated hermes-sweeper review.


/** Persist a stored session's workspace without foregrounding its profile. */
setSessionWorkspace: async (change: SessionWorkspaceChange): Promise<SessionWorkspaceResult> =>
requestGatewayForProfile<SessionWorkspaceResult>(change.profile, 'session.workspace.set', {

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.

requestGatewayForProfile changes the socket, but this handler selects its database from params['profile'] (_profile_db). App-global remote mode can share one backend, so please include profile: change.profile in this payload and cover the same durable id existing in two profile DBs.

Comment thread agent/account_usage.py
return value.astimezone(timezone.utc).isoformat().removesuffix("+00:00") + "Z"


def account_usage_snapshot_to_dict(

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.

This serializer is not exposed by a gateway RPC in this PR. The linked companion plugin requests usage.providers, so it cannot consume this output yet. Please add and test that endpoint here, or split the unfinished provider-statusline portion.

@alt-glitch alt-glitch added type/feature New feature or request comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/tui Terminal UI (ui-tui/ + tui_gateway/) comp/desktop Electron desktop app (apps/desktop/*) area/usage-cost Token accounting, usage reporting, billing, cost tracking P3 Low — cosmetic, nice to have needs-decision Awaiting maintainer decision before any implementation sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state labels Aug 2, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Related: #58339 (provider account/rate-limit usage surface), #33094 (provider-usage request), and #66484 (Desktop plugin workspace capability). This PR combines a distinct Desktop-plugin session-actions SDK with profile-aware durable workspace mutation; the public API contract needs maintainer direction.

@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users area/sessions Session lifecycle, resume, persistence, history labels Aug 2, 2026
@Codezilla-jpg

Copy link
Copy Markdown
Author

Rückgängig gemacht - Plugin soll privat bleiben.

@Codezilla-jpg
Codezilla-jpg deleted the feat/statusline-workspaces-full branch August 2, 2026 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/sessions Session lifecycle, resume, persistence, history area/usage-cost Token accounting, usage reporting, billing, cost tracking comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/desktop Electron desktop app (apps/desktop/*) comp/tui Terminal UI (ui-tui/ + tui_gateway/) needs-decision Awaiting maintainer decision before any implementation P3 Low — cosmetic, nice to have sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants