Add change summaries, inline diff hunks and screenshots to reviews
This commit is contained in:
@@ -33,6 +33,7 @@ type Options struct {
|
||||
Guidance string
|
||||
Reminder string
|
||||
MCPServers []*mcp.Server
|
||||
StdioMCP []mcp.Stdio
|
||||
Transcript io.Writer
|
||||
OnBadLine func(line []byte, reason string)
|
||||
}
|
||||
@@ -193,6 +194,7 @@ func (s *Session) open(ctx context.Context, opts Options) error {
|
||||
ApprovalPolicy: json.RawMessage(`"never"`),
|
||||
Sandbox: SandboxModeDangerFullAccess,
|
||||
DeveloperInstructions: opts.Guidance,
|
||||
Config: stdioConfig(opts.StdioMCP),
|
||||
}, &resp)
|
||||
if err != nil {
|
||||
return fmt.Errorf("resume thread: %w", err)
|
||||
@@ -211,6 +213,7 @@ func (s *Session) open(ctx context.Context, opts Options) error {
|
||||
ApprovalPolicy: json.RawMessage(`"never"`),
|
||||
Sandbox: SandboxModeDangerFullAccess,
|
||||
DeveloperInstructions: opts.Guidance,
|
||||
Config: stdioConfig(opts.StdioMCP),
|
||||
}, &resp)
|
||||
if err != nil {
|
||||
return fmt.Errorf("fork thread: %w", err)
|
||||
@@ -227,6 +230,7 @@ func (s *Session) open(ctx context.Context, opts Options) error {
|
||||
Sandbox: SandboxModeDangerFullAccess,
|
||||
DeveloperInstructions: opts.Guidance,
|
||||
DynamicTools: dynamicTools(opts.MCPServers),
|
||||
Config: stdioConfig(opts.StdioMCP),
|
||||
}, &resp)
|
||||
if err != nil {
|
||||
return fmt.Errorf("start thread: %w", err)
|
||||
@@ -235,6 +239,17 @@ func (s *Session) open(ctx context.Context, opts Options) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func stdioConfig(servers []mcp.Stdio) map[string]any {
|
||||
if len(servers) == 0 {
|
||||
return nil
|
||||
}
|
||||
cfg := map[string]any{}
|
||||
for _, srv := range servers {
|
||||
cfg[srv.Name] = map[string]any{"command": srv.Command, "args": srv.Args}
|
||||
}
|
||||
return map[string]any{"mcp_servers": cfg}
|
||||
}
|
||||
|
||||
func dynamicTools(servers []*mcp.Server) []DynamicToolSpec {
|
||||
specs := []DynamicToolSpec{}
|
||||
for _, srv := range servers {
|
||||
|
||||
Reference in New Issue
Block a user