Skip to content

Feature Request: emit ACP usage_update so ACP clients can show context-window usage #42

Description

@sunnymodi21

Summary

In ACP mode (droid exec --output-format acp), Droid never reports context-window usage. So ACP clients can't show a context meter, even though Droid already computes these numbers for /context and for the stream-jsonrpc protocol.

Please emit the standard ACP usage_update session notification:

{
  "jsonrpc": "2.0",
  "method": "session/update",
  "params": {
    "sessionId": "…",
    "update": { "sessionUpdate": "usage_update", "used": 48213, "size": 200000 }
  }
}

used / size map directly to usedTokens / contextBudget from droid.get_context_breakdown. Clients such as bb already turn usage_update into a context meter, so no client-side changes are needed.

Current behavior (droid 0.226.2, macOS arm64)

  • A full session/prompt turn over ACP emits only current_mode_update, config_option_update, available_commands_update and message/thought/tool updates. There is no usage_update, and the prompt result is just {"stopReason":"end_turn"}.
  • /context isn't in available_commands_update over ACP. Sending it as a prompt goes to the model as plain text.
  • droid.get_context_stats / droid.get_context_breakdown exist in stream-jsonrpc mode, but over ACP they return -32601 Method not found, including as _-prefixed extension methods. The ACP agent's extMethod only handles session/list, session/resume and session/set_config_option.
  • The token counts are persisted, e.g. lastCallTokenUsage in ~/.factory/sessions/<cwd>/<id>.settings.json, but ACP clients have no supported way to read them.

Suggested behavior

  • Send usage_update after each model call, or at least at the end of each turn, and after compaction.
  • Optionally, also expose droid.get_context_breakdown as an ACP extension method (e.g. _droid/get_context_breakdown) so clients can show the per-category breakdown.

Related

Rewind has the same gap: droid.get_rewind_info / droid.execute_rewind / droid.fork_session exist in stream-jsonrpc, but ACP initialize advertises only sessionCapabilities: { list, resume }, with no fork. Advertising sessionCapabilities.fork would let ACP clients offer forking too.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions