-
-
Notifications
You must be signed in to change notification settings - Fork 367
feat(workflow): opt-in settled result API #109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: pr/dw-9-resume-iteration-inspection
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,16 @@ function api(meta: WorkflowMeta, logs?: string[]): WorkflowSandboxApi { | |
| agent: async () => "", | ||
| parallel: async () => [], | ||
| pipeline: async () => [], | ||
| settle: async <T>(task: () => T | Promise<T>) => { | ||
| try { | ||
| return { ok: true, value: await task() }; | ||
| } catch (error) { | ||
| return { | ||
| ok: false, | ||
| error: { kind: "internal", message: String(error), retryable: false }, | ||
| }; | ||
| } | ||
| }, | ||
|
Comment on lines
+15
to
+24
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Match production Error-message normalization in both test doubles. Production returns
📍 Affects 2 files
🤖 Prompt for AI Agents |
||
| phase: () => {}, | ||
| log: (msg: unknown) => { | ||
| logs?.push(String(msg)); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Scope the journaling claim to agent calls.
settle()does not journal itself:settle(() => { throw new Error("x") })returns failure data without an agent-call record. Limit the statement to underlying agent calls that fail after execution begins.Proposed wording
📝 Committable suggestion
🤖 Prompt for AI Agents