Unify structured call completion and retain typed failures

This commit is contained in:
2026-11-16 14:27:54 +00:00
parent e98e525b5c
commit c2c8050bc8
18 changed files with 313 additions and 186 deletions

View File

@@ -36,14 +36,15 @@ func (c *RoleClient) Coordinate(ctx context.Context, start *structuredoutput.Exc
return &pk.RunRequest{}, nil
}
var output json.RawMessage
pending, err = c.prepareCall(ctx, *selected, &output, nil)
call, err := c.prepareCall(ctx, *selected, &output, nil)
if err != nil {
_, domainErr := next(ctx, structuredoutput.Turn{Response: &structuredoutput.Response{}, Err: err})
_, domainErr := next(ctx, structuredoutput.Turn{Response: &call.response, Err: err})
if domainErr != nil {
return nil, domainErr
}
return nil, err
}
pending = call
return &pending.request, nil
},
})