mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-06 00:12:11 +00:00
Merge agent and mode into one (#1689)
The concept of mode has been deprecated, there is now only the agent field in the config. An agent can be cycled through as your primary agent with <tab> or you can spawn a subagent by @ mentioning it. if you include a description of when to use it, the primary agent will try to automatically use it Full docs here: https://opencode.ai/docs/agents/
This commit is contained in:
parent
12f1ad521f
commit
c34aec060f
42 changed files with 1755 additions and 930 deletions
|
|
@ -133,11 +133,13 @@ func NewRequestConfig(ctx context.Context, method string, u string, body interfa
|
|||
// Fallback to json serialization if none of the serialization functions that we expect
|
||||
// to see is present.
|
||||
if body != nil && !hasSerializationFunc {
|
||||
content, err := json.Marshal(body)
|
||||
if err != nil {
|
||||
buf := new(bytes.Buffer)
|
||||
enc := json.NewEncoder(buf)
|
||||
enc.SetEscapeHTML(true)
|
||||
if err := enc.Encode(body); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
reader = bytes.NewBuffer(content)
|
||||
reader = buf
|
||||
}
|
||||
|
||||
req, err := http.NewRequestWithContext(ctx, method, u, nil)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue