mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-16 18:03:56 +00:00
fix: opencode compat tool call rendering and default to no-token (#95)
- Fix tool name lost on ToolResult events (persist via tool_name_by_call) - Fix tool input lost on ToolResult events (persist via tool_args_by_call) - Fix tool output in wrong field (error -> output) - Fix text doubling in streaming (defer emit to ItemCompleted) - Fix missing delta field in text streaming events - Default server mode to no-token when --token not specified - Add install-fast-sa and install-fast-gigacode justfile targets
This commit is contained in:
parent
a02393436c
commit
6a3345b954
32 changed files with 9193 additions and 38 deletions
|
|
@ -509,6 +509,82 @@ const pollInterval = setInterval(async () => {
|
|||
}, 2000);
|
||||
```
|
||||
|
||||
## Model Discovery
|
||||
|
||||
OpenCode has the richest model discovery support with both CLI and HTTP API.
|
||||
|
||||
### CLI Commands
|
||||
|
||||
```bash
|
||||
opencode models # List all available models
|
||||
opencode models <provider> # List models for a specific provider
|
||||
```
|
||||
|
||||
### HTTP Endpoint
|
||||
|
||||
```
|
||||
GET /provider
|
||||
```
|
||||
|
||||
### Response Schema
|
||||
|
||||
```json
|
||||
{
|
||||
"all": [
|
||||
{
|
||||
"id": "anthropic",
|
||||
"name": "Anthropic",
|
||||
"api": "string",
|
||||
"env": ["ANTHROPIC_API_KEY"],
|
||||
"npm": "string",
|
||||
"models": {
|
||||
"model-key": {
|
||||
"id": "string",
|
||||
"name": "string",
|
||||
"family": "string",
|
||||
"release_date": "string",
|
||||
"attachment": true,
|
||||
"reasoning": false,
|
||||
"tool_call": true,
|
||||
"cost": {
|
||||
"input": 0.003,
|
||||
"output": 0.015,
|
||||
"cache_read": 0.0003,
|
||||
"cache_write": 0.00375
|
||||
},
|
||||
"limit": {
|
||||
"context": 200000,
|
||||
"input": 200000,
|
||||
"output": 8192
|
||||
},
|
||||
"modalities": {
|
||||
"input": ["text", "image"],
|
||||
"output": ["text"]
|
||||
},
|
||||
"experimental": false,
|
||||
"status": "beta"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"default": {
|
||||
"anthropic": "claude-sonnet-4-20250514"
|
||||
},
|
||||
"connected": ["anthropic"]
|
||||
}
|
||||
```
|
||||
|
||||
### SDK Usage
|
||||
|
||||
```typescript
|
||||
const client = createOpencodeClient();
|
||||
const response = await client.provider.list();
|
||||
```
|
||||
|
||||
### How to Replicate
|
||||
|
||||
When an OpenCode server is running, call `GET /provider` on its HTTP port. Returns full model metadata including capabilities, costs, context limits, and modalities.
|
||||
|
||||
## Notes
|
||||
|
||||
- OpenCode is the most feature-rich runtime (streaming, questions, permissions)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue