17 lines
536 B
Go
17 lines
536 B
Go
package opencode
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
)
|
|
|
|
// BudgetMessages uses the same owned endpoint and credentials, without sharing
|
|
// mutable request diagnostics or generation state with the main connection.
|
|
func (c *Connection) BudgetMessages(ctx context.Context, id string) ([]byte, error) {
|
|
if !sessionID.MatchString(id) {
|
|
return nil, fmt.Errorf("invalid session ID")
|
|
}
|
|
reader := &Connection{Backend: c.Backend, Executable: c.Executable, Directory: c.Directory, URL: c.URL, password: c.password}
|
|
return reader.Messages(ctx, id)
|
|
}
|