mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-18 17:04:49 +00:00
Update rpc.md to match actual implementation
- AppMessage -> AgentMessage - compact response shows full CompactionResult fields - auto_compaction_start includes reason field - auto_compaction_end includes willRetry field - Fix source file references
This commit is contained in:
parent
ee64d29487
commit
17ed3fa605
1 changed files with 16 additions and 7 deletions
|
|
@ -145,7 +145,7 @@ Response:
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Messages are `AppMessage` objects (see [Message Types](#message-types)).
|
Messages are `AgentMessage` objects (see [Message Types](#message-types)).
|
||||||
|
|
||||||
### Model
|
### Model
|
||||||
|
|
||||||
|
|
@ -289,8 +289,10 @@ Response:
|
||||||
"command": "compact",
|
"command": "compact",
|
||||||
"success": true,
|
"success": true,
|
||||||
"data": {
|
"data": {
|
||||||
|
"summary": "Summary of conversation...",
|
||||||
|
"firstKeptEntryId": "abc123",
|
||||||
"tokensBefore": 150000,
|
"tokensBefore": 150000,
|
||||||
"summary": "Summary of conversation..."
|
"details": {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
@ -618,7 +620,7 @@ A turn consists of one assistant response plus any resulting tool calls and resu
|
||||||
|
|
||||||
### message_start / message_end
|
### message_start / message_end
|
||||||
|
|
||||||
Emitted when a message begins and completes. The `message` field contains an `AppMessage`.
|
Emitted when a message begins and completes. The `message` field contains an `AgentMessage`.
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{"type": "message_start", "message": {...}}
|
{"type": "message_start", "message": {...}}
|
||||||
|
|
@ -717,20 +719,27 @@ Use `toolCallId` to correlate events. The `partialResult` in `tool_execution_upd
|
||||||
Emitted when automatic compaction runs (when context is nearly full).
|
Emitted when automatic compaction runs (when context is nearly full).
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{"type": "auto_compaction_start"}
|
{"type": "auto_compaction_start", "reason": "threshold"}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
The `reason` field is `"threshold"` (context getting large) or `"overflow"` (context exceeded limit).
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"type": "auto_compaction_end",
|
"type": "auto_compaction_end",
|
||||||
"result": {
|
"result": {
|
||||||
|
"summary": "Summary of conversation...",
|
||||||
|
"firstKeptEntryId": "abc123",
|
||||||
"tokensBefore": 150000,
|
"tokensBefore": 150000,
|
||||||
"summary": "Summary of conversation..."
|
"details": {}
|
||||||
},
|
},
|
||||||
"aborted": false
|
"aborted": false,
|
||||||
|
"willRetry": false
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
If `reason` was `"overflow"` and compaction succeeds, `willRetry` is `true` and the agent will automatically retry the prompt.
|
||||||
|
|
||||||
If compaction was aborted, `result` is `null` and `aborted` is `true`.
|
If compaction was aborted, `result` is `null` and `aborted` is `true`.
|
||||||
|
|
||||||
### auto_retry_start / auto_retry_end
|
### auto_retry_start / auto_retry_end
|
||||||
|
|
@ -806,7 +815,7 @@ Parse errors:
|
||||||
|
|
||||||
Source files:
|
Source files:
|
||||||
- [`packages/ai/src/types.ts`](../../ai/src/types.ts) - `Model`, `UserMessage`, `AssistantMessage`, `ToolResultMessage`
|
- [`packages/ai/src/types.ts`](../../ai/src/types.ts) - `Model`, `UserMessage`, `AssistantMessage`, `ToolResultMessage`
|
||||||
- [`packages/agent/src/types.ts`](../../agent/src/types.ts) - `AppMessage`, `Attachment`, `AgentEvent`
|
- [`packages/agent/src/types.ts`](../../agent/src/types.ts) - `AgentMessage`, `AgentEvent`
|
||||||
- [`src/core/messages.ts`](../src/core/messages.ts) - `BashExecutionMessage`
|
- [`src/core/messages.ts`](../src/core/messages.ts) - `BashExecutionMessage`
|
||||||
- [`src/modes/rpc/rpc-types.ts`](../src/modes/rpc/rpc-types.ts) - RPC command/response types
|
- [`src/modes/rpc/rpc-types.ts`](../src/modes/rpc/rpc-types.ts) - RPC command/response types
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue