C.W.K.
Stream
Lesson 05 of 05 · published

Deployment Patterns and Graceful Failure

~28 min · deployment, queues, fallback

Level 0Observer
0 XP0/40 lessons0/12 achievements
0/100 XP to next level100 XP to go0% complete

How the agent runs changes the product

A synchronous API agent, a background worker, a scheduled monitor, and an event-driven webhook agent have different failure modes. Choose the deployment shape before pretending the prompt solved architecture.

Long-running agents usually belong behind queues or job runners. Users get status, cancellation, and partial results instead of a hanging request.

Graceful failure is a feature

When an agent fails, it should preserve state, explain what was completed, identify what failed, suggest next action, and avoid pretending success.

The best failure mode is often a handoff: to a human, a simpler workflow, or a saved draft. Silent failure is betrayal. Loud failure with state is recoverable.

Code

Failure response·json
{"status":"paused","completed":["read logs","identified failing migration"],"failed_step":"apply fix","reason":"database credentials unavailable","safe_next_action":"ask operator for staging DB access","resume_state_id":"run_42_checkpoint_7"}

External links

Exercise

Choose a deployment shape for a research agent and a deployment agent. Explain why they should not run the same way.
Hint
Think latency, risk, cancellation, and external side effects.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.