Add change summaries, inline diff hunks and screenshots to reviews

This commit is contained in:
Ian Gulliver
2026-10-15 19:02:33 -07:00
parent ed40d91a42
commit a2067c2ba0
14 changed files with 442 additions and 32 deletions
+15
View File
@@ -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 {