II.
Page JSON
Structured · livepage:docs-harness-features-backlog-gaps-tools-capabilities-gap-tools-028
GAP-TOOLS-028: Sleep/Delay Effect Enhancement json
Inspect the normalized record payload exactly as the atlas UI reads it.
{
"id": "page:docs-harness-features-backlog-gaps-tools-capabilities-gap-tools-028",
"_kind": "Page",
"_file": "wiki/docs/harness-features-backlog/gaps/tools-capabilities/gap-tools-028.md",
"_cluster": "wiki",
"attributes": {
"nodeKind": "Page",
"sourcePath": "docs/harness-features-backlog/gaps/tools-capabilities/GAP-TOOLS-028.md",
"sourceKind": "repo-docs",
"title": "GAP-TOOLS-028: Sleep/Delay Effect Enhancement",
"displayName": "GAP-TOOLS-028: Sleep/Delay Effect Enhancement",
"slug": "docs/harness-features-backlog/gaps/tools-capabilities/gap-tools-028",
"articlePath": "wiki/docs/harness-features-backlog/gaps/tools-capabilities/GAP-TOOLS-028.md",
"article": "\n# GAP-TOOLS-028: Sleep/Delay Effect Enhancement\n\n| Field | Value |\n|-------|-------|\n| Category | tools-capabilities |\n| Priority | Low |\n| Effort | S |\n| Status | Partial |\n\n## Description\nEnhance the existing `ctx.sleepUntil()` effect with richer delay semantics: relative durations, conditional wake (sleep until condition), retry-with-backoff patterns, and integration with the scheduling system. Document current capabilities and gaps.\n\n## Current State\nThe `ctx.sleepUntil()` intrinsic exists as a `ProcessContext` effect that pauses execution until a specified timestamp. The `sleep` task kind is registered. Sleep effects go through the journal and replay system. However: only absolute timestamps are supported (no relative durations like \"wait 5 minutes\"), no conditional wake mechanism, no built-in retry-with-backoff pattern, and no integration with scheduling.\n\n## Target State\nExtended sleep API: `ctx.sleep(duration)` for relative delays, `ctx.sleepUntil(timestamp)` (existing), `ctx.waitFor(condition, options)` for conditional wake with polling interval and timeout, `ctx.retryWithBackoff(task, options)` for exponential backoff retry patterns. All variants journal-tracked and replayable.\n\n## Dependencies\n- [GAP-TOOLS-020](../tools-capabilities/GAP-TOOLS-020.md) -- scheduling integration for long sleeps\n\n## Key Files\n| Component | Path |\n|-----------|------|\n| Process context | `packages/sdk/src/runtime/processContext.ts` |\n| Task definitions | `packages/sdk/src/tasks/` |\n| Replay engine | `packages/sdk/src/runtime/replay/` |\n\n## Recommendation\nPhase 4 implementation. Add `ctx.sleep(duration)` as syntactic sugar over `ctx.sleepUntil()`. Implement `ctx.waitFor()` as a polling effect. Build `ctx.retryWithBackoff()` as a composition of task + sleep effects. Low effort since the foundation exists.\n",
"documents": []
},
"outgoingEdges": [],
"incomingEdges": [
{
"from": "page:docs-harness-features-backlog",
"to": "page:docs-harness-features-backlog-gaps-tools-capabilities-gap-tools-028",
"kind": "contains_page"
}
]
}