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.
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/contextand for thestream-jsonrpcprotocol.Please emit the standard ACP
usage_updatesession notification:{ "jsonrpc": "2.0", "method": "session/update", "params": { "sessionId": "…", "update": { "sessionUpdate": "usage_update", "used": 48213, "size": 200000 } } }used/sizemap directly tousedTokens/contextBudgetfromdroid.get_context_breakdown. Clients such as bb already turnusage_updateinto a context meter, so no client-side changes are needed.Current behavior (droid 0.226.2, macOS arm64)
session/promptturn over ACP emits onlycurrent_mode_update,config_option_update,available_commands_updateand message/thought/tool updates. There is nousage_update, and the prompt result is just{"stopReason":"end_turn"}./contextisn't inavailable_commands_updateover ACP. Sending it as a prompt goes to the model as plain text.droid.get_context_stats/droid.get_context_breakdownexist instream-jsonrpcmode, but over ACP they return-32601 Method not found, including as_-prefixed extension methods. The ACP agent'sextMethodonly handlessession/list,session/resumeandsession/set_config_option.lastCallTokenUsagein~/.factory/sessions/<cwd>/<id>.settings.json, but ACP clients have no supported way to read them.Suggested behavior
usage_updateafter each model call, or at least at the end of each turn, and after compaction.droid.get_context_breakdownas 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_sessionexist instream-jsonrpc, but ACPinitializeadvertises onlysessionCapabilities: { list, resume }, with nofork. AdvertisingsessionCapabilities.forkwould let ACP clients offer forking too.