-
Notifications
You must be signed in to change notification settings - Fork 30
docs(agent): document the default pause deadline across the SDK and examples [SAP-3207] #850
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: main
Are you sure you want to change the base?
Changes from all commits
49a70d5
d7677d5
5a7644f
1f6bdfe
5fe97d7
213b693
4d0845a
1f12443
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 |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| --- | ||
| "@sapiom/agent": patch | ||
| --- | ||
|
|
||
| Document the pause deadline on `pauseUntilSignal`, `PauseUntilSignalDirective.timeoutMs` and `Pause.timeoutMs`. | ||
|
|
||
| Forthcoming behavior change on the hosted engine, not in this package: a pause that omits `timeoutMs` waits indefinitely today, and will instead carry a 7-day deadline once the engine change for SAP-3207 is deployed. Past that deadline the run is finalized as failed rather than parking silently, carrying the engine's pause-timeout error, so a run that used to hang forever will surface as a failure. Pass an explicit `timeoutMs` on a signal pause that must outlive a week, such as a human approval gate; a pause on a dispatched child agent needs none, since the engine waives the deadline while the child is alive. `run_local` is unaffected either way: it never applies or enforces a pause deadline, it auto-resumes every pause immediately. | ||
|
|
||
| This package ships documentation only, with no type, signature or runtime change. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -54,6 +54,15 @@ const APPROVAL_SIGNAL = "approval.decision"; | |
| /** The signal a candidate fires to accept or decline a provisional offer. */ | ||
| const CONFIRM_SIGNAL = "candidate.confirm"; | ||
|
|
||
| /** | ||
| * Explicit deadline for a human gate, one year. A pause with no `timeoutMs` | ||
| * inherits the engine's 7-day default, and a lapsed deadline *terminates* the | ||
| * run rather than resuming it, so the default would hard-fail any approval | ||
| * slower than a week. Long enough that a slow approver never loses the run, | ||
| * finite enough that an abandoned one still reaches a terminal state. | ||
|
Comment on lines
+61
to
+62
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 State that the one-year deadline can still terminate the run. These statements promise that a slow approver never loses the run. The configured deadline is finite. Expiry terminates the run.
📍 Affects 3 files
🤖 Prompt for AI Agents |
||
| */ | ||
| const GATE_PAUSE_TIMEOUT_MS = 365 * 24 * 60 * 60 * 1000; | ||
|
|
||
| // ─────────────────────────────────────────────────────────────── shapes ── | ||
| /** String-only config bag (matches how templates receive their `config`). */ | ||
| type Config = Record<string, string>; | ||
|
|
@@ -417,6 +426,7 @@ const notifyApprover = defineStep({ | |
| signal: APPROVAL_SIGNAL, | ||
| resumeStep: "onDecision", | ||
| correlationId: ctx.executionId, | ||
| timeoutMs: GATE_PAUSE_TIMEOUT_MS, | ||
| }); | ||
| }, | ||
| }); | ||
|
|
@@ -500,6 +510,7 @@ const offer = defineStep({ | |
| signal: CONFIRM_SIGNAL, | ||
| resumeStep: "resolve", | ||
| correlationId: ctx.executionId, | ||
| timeoutMs: GATE_PAUSE_TIMEOUT_MS, | ||
|
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 | 🟠 Major | 🏗️ Heavy lift Do not use the pause deadline as candidate fallback. Line 513 sets a terminal engine deadline. Expiry fails the run. It does not deliver Schedule an explicit 🤖 Prompt for AI Agents |
||
| }); | ||
| }, | ||
| }); | ||
|
|
||
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.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
Remove the non-exported
PauseTimeoutErrorreference.Line 59 presents
PauseTimeoutErroras an SDK-visible error.@sapiom/agentdoes not export this engine-side error, so readers cannot import or catch it from the SDK. Describe the outcome as an engine-terminated timeout without naming this error.Suggested wording
📝 Committable suggestion
🤖 Prompt for AI Agents