> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.astropods.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.astropods.com/_mcp/server.

# Auxiliary RPCs

Beyond [the conversation stream](/messaging-sdk/conversation-stream), the sidecar exposes these RPCs:

| RPC                       | When to use                                                                                      |
| ------------------------- | ------------------------------------------------------------------------------------------------ |
| `ProcessMessage`          | Server-streaming for one-shot request/response. Same `AgentResponse` shape, no inbound feedback. |
| `GetThreadHistory`        | Pull current thread state (handles edits/deletions).                                             |
| `GetConversationMetadata` | Look up a conversation by ID or by `(platform, channel, thread)` without fetching history.       |
| `ProcessAudioStream`      | Dedicated audio-only stream. First message must be `AudioStreamConfig`, rest are `AudioChunk`s.  |
| `HealthCheck`             | Returns `HEALTHY` / `DEGRADED` / `UNHEALTHY` plus the sidecar version.                           |

## Thread history

#### Node

**`ThreadHistoryRequest`**

| Field            | Type    | Required | Default | Notes                               |
| ---------------- | ------- | -------- | ------- | ----------------------------------- |
| `conversationId` | string  | yes      | —       | Conversation to query.              |
| `maxMessages`    | number  | no       | 50      | How many recent messages to return. |
| `includeEdited`  | boolean | no       | true    | Include edit history.               |
| `includeDeleted` | boolean | no       | false   | Include deleted markers.            |

**`ThreadHistoryResponse`**

| Field            | Type              | Notes                                  |
| ---------------- | ----------------- | -------------------------------------- |
| `conversationId` | string            | Echoes the request.                    |
| `messages`       | `ThreadMessage[]` | Recent messages.                       |
| `isComplete`     | boolean           | `false` if truncated by `maxMessages`. |
| `fetchedAt`      | `Timestamp`       | When the snapshot was taken.           |

**`ThreadMessage`**

| Field             | Type                        | Notes                                 |
| ----------------- | --------------------------- | ------------------------------------- |
| `messageId`       | string                      | Platform message ID.                  |
| `user`            | `User`                      | Author.                               |
| `content`         | string                      | Current content (after edits).        |
| `attachments`     | `Attachment[]`              | Attachments on the message.           |
| `timestamp`       | `Timestamp`                 | When it was sent.                     |
| `wasEdited`       | boolean                     | True if the message has been edited.  |
| `originalContent` | string                      | Content before edits.                 |
| `editedAt`        | `Timestamp`                 | Last edit time.                       |
| `isDeleted`       | boolean                     | True if the message has been deleted. |
| `deletedAt`       | `Timestamp`                 | Deletion time.                        |
| `platformData`    | `{ [key: string]: string }` | Platform-specific extras.             |

```typescript
const history = await client.getThreadHistory(conversationId, 50);
for (const m of history.messages) {
  // m.content, m.wasEdited, m.isDeleted, m.originalContent, ...
}
```

#### Python

**`ThreadHistoryRequest`**

| Field             | Type   | Required | Default | Notes                               |
| ----------------- | ------ | -------- | ------- | ----------------------------------- |
| `conversation_id` | string | yes      | —       | Conversation to query.              |
| `max_messages`    | int32  | no       | 50      | How many recent messages to return. |
| `include_edited`  | bool   | no       | true    | Include edit history.               |
| `include_deleted` | bool   | no       | false   | Include deleted markers.            |

**`ThreadHistoryResponse`**

| Field             | Type                        | Notes                                   |
| ----------------- | --------------------------- | --------------------------------------- |
| `conversation_id` | string                      | Echoes the request.                     |
| `messages`        | `repeated ThreadMessage`    | Recent messages.                        |
| `is_complete`     | bool                        | `False` if truncated by `max_messages`. |
| `fetched_at`      | `google.protobuf.Timestamp` | When the snapshot was taken.            |

**`ThreadMessage`**

| Field              | Type                        | Notes                                 |
| ------------------ | --------------------------- | ------------------------------------- |
| `message_id`       | string                      | Platform message ID.                  |
| `user`             | `User`                      | Author.                               |
| `content`          | string                      | Current content (after edits).        |
| `attachments`      | `repeated Attachment`       | Attachments on the message.           |
| `timestamp`        | `google.protobuf.Timestamp` | When it was sent.                     |
| `was_edited`       | bool                        | True if the message has been edited.  |
| `original_content` | string                      | Content before edits.                 |
| `edited_at`        | `google.protobuf.Timestamp` | Last edit time.                       |
| `is_deleted`       | bool                        | True if the message has been deleted. |
| `deleted_at`       | `google.protobuf.Timestamp` | Deletion time.                        |
| `platform_data`    | `map<string, string>`       | Platform-specific extras.             |

```python
from astropods_messaging.astro.messaging.v1.service_pb2 import (
    ThreadHistoryRequest,
)
history = stub.GetThreadHistory(ThreadHistoryRequest(
    conversation_id=cid, max_messages=50,
))
for m in history.messages:
    ...  # m.content, m.was_edited, m.is_deleted, m.original_content
```

## Next steps

* [Save a conversation from another source](/messaging-sdk/saved-conversations): import an external transcript
* [Reconnection](/messaging-sdk/reconnection): keep the stream alive across drops