mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-20 15:00:46 +08:00
重构主控编排与运行时预热链路,统一工作区提示词/专家调度协议并补齐 wiki 记忆注入与写回闭环。
同时收敛启动与运维脚本默认行为(含 wiki worker)、更新 Admin 可观测性与相关测试,降低首轮时延并提高运行稳定性。 Made-with: Cursor
This commit is contained in:
parent
4a23b715a2
commit
dbbe3add6a
14438 changed files with 2693620 additions and 2546 deletions
|
|
@ -0,0 +1,63 @@
|
|||
# Retry with Backoff Example
|
||||
# Demonstrates automatic retry patterns for resilient API calls
|
||||
|
||||
# Simple retry - try up to 3 times on failure
|
||||
session "Call flaky third-party API"
|
||||
retry: 3
|
||||
|
||||
# Retry with exponential backoff for rate-limited APIs
|
||||
session "Query rate-limited service"
|
||||
retry: 5
|
||||
backoff: "exponential"
|
||||
|
||||
# Retry with linear backoff
|
||||
session "Send webhook notification"
|
||||
retry: 3
|
||||
backoff: "linear"
|
||||
|
||||
# Combining retry with context passing
|
||||
let config = session "Load API configuration"
|
||||
|
||||
session "Make authenticated API request"
|
||||
context: config
|
||||
retry: 3
|
||||
backoff: "exponential"
|
||||
|
||||
# Retry inside try/catch for fallback after all retries fail
|
||||
try:
|
||||
session "Call primary payment processor"
|
||||
retry: 3
|
||||
backoff: "exponential"
|
||||
catch:
|
||||
session "All retries failed - use backup payment processor"
|
||||
retry: 2
|
||||
|
||||
# Parallel retries for redundant services
|
||||
parallel:
|
||||
primary = try:
|
||||
session "Query primary database"
|
||||
retry: 2
|
||||
backoff: "linear"
|
||||
catch:
|
||||
session "Primary DB unavailable"
|
||||
replica = try:
|
||||
session "Query replica database"
|
||||
retry: 2
|
||||
backoff: "linear"
|
||||
catch:
|
||||
session "Replica DB unavailable"
|
||||
|
||||
session "Merge results from available databases"
|
||||
context: { primary, replica }
|
||||
|
||||
# Retry in a loop for batch processing
|
||||
let items = ["batch1", "batch2", "batch3"]
|
||||
for item in items:
|
||||
try:
|
||||
session "Process this batch item"
|
||||
context: item
|
||||
retry: 2
|
||||
backoff: "exponential"
|
||||
catch:
|
||||
session "Log failed batch for manual review"
|
||||
context: item
|
||||
Loading…
Add table
Add a link
Reference in a new issue