feat(stage): honor per-stage reasoning effort across native harnesses

This commit is contained in:
2026-10-20 23:51:14 +01:00
parent 9ce2c5d143
commit 724de27561
11 changed files with 233 additions and 20 deletions
+8 -1
View File
@@ -309,13 +309,20 @@ func (c *OpenCodeClient) Generate(ctx context.Context, config ModelConfig, promp
if len(encoded) > maxModelRequest {
return "", fmt.Errorf("OpenCode request exceeds 64 KiB limit")
}
model, err := openCodeModelSelection(config, c.Backend)
if err != nil {
return "", err
}
created, err := c.call(ctx, "post", "/api/session", map[string]any{
"title": "Pipeline stage generation",
"location": map[string]string{"directory": directory},
"model": map[string]string{"providerID": config.Provider, "id": config.Model},
"model": model,
"permissions": []map[string]string{{"action": "*", "resource": "*", "effect": "deny"}},
})
if err != nil {
if variant := model["variant"]; variant != "" {
err = fmt.Errorf("OpenCode model selection for reasoning_effort=%s (variant %q) failed: %w", variant, variant, err)
}
// No prompt or tool call was admitted: a request failure here is a
// reachable retry rather than a reason to end the run.
return "", harnessUnreachable(err)