Back to blog
EngineeringJul 15, 2026· min read

Teaching Agents Operational Discipline: From Reactive Fixes to Proactive Patterns

Three recent infrastructure shipments reveal a pattern: we're moving from reactive failure handling to proactive operational discipline. Here's what we learned teaching agents when to checkpoint, when to alert, and when to ask for help.

I've been looking at our recent infrastructure shipments and noticing a pattern I didn't plan but should have. Over the past three weeks, we shipped checkpoint self-suspension, drift alert Slack notifications, and streaming dispatch unification. On paper, these are three unrelated backend improvements. In practice, they're all teaching the same lesson: autonomous agents need operational discipline, not just capability.

The Problem: Capable Agents, Brittle Operations

Strug Works can write code, ship features, and close Linear issues without human intervention. That's been true for months. But capability without discipline creates a different class of problems:

An agent hits token limits mid-task and loses all progress because it never thought to save state. Another agent detects configuration drift between Supabase and local schema but only logs it to a file no one reads. A third completes a streaming response but skips post-task cleanup because that code path doesn't route through the same dispatch logic.

These aren't capability failures. They're discipline failures. The agents knew what to do. They didn't know when to stop, when to alert, or when to ask for help.

Shipment One: Teaching Agents When to Ask for Help

We shipped proactive checkpoint and self-suspension on 2026-07-13 (commit b565ec5, PR #199). The feature gives agents two new capabilities:

1. better_checkpoint — Save progress at strategic milestones (schema migration complete, test suite passing, PR opened but not merged). The agent decides when progress is worth preserving.

2. better_suspend — Suspend execution and request human review when the agent detects it's approaching token limits, stuck in a retry loop, or facing a decision outside its directive scope.

Before this, agents either finished or failed. Now they can pause, document their progress, and hand off cleanly. It's the difference between an engineer who works until they burn out versus one who says "I've hit a blocker, here's what I've done, here's what I need."

The technical implementation was straightforward — two new tool functions, state serialization to the tasks table, and Linear issue updates so I can see what happened. The conceptual shift was harder: teaching agents that asking for help is not failure, it's professionalism.

Shipment Two: Closing the Loop on Drift Detection

We shipped drift alert Slack integration the same day (commit 144f05b, PR #272). This one was embarrassing. We had a schema drift detection agent that would compare Supabase production state against our local TypeScript definitions, identify discrepancies, and… write them to a log file.

No notification. No alert. Just a JSON file in a directory I'd check manually if I remembered. Which I didn't.

The new behavior: when drift is detected, the agent posts a structured message to our internal Slack channel with the delta summary, affected tables, and a recommended action. I see it immediately. I can acknowledge or escalate. The loop closes.

This isn't about Slack. It's about teaching agents that observation without communication is incomplete work. Detecting a problem and telling no one is operationally equivalent to not detecting it at all.

Shipment Three: One Dispatch Path for All Responses

We shipped streaming dispatch unification yesterday (commit 9e2f069, PR #274). This one was less visible but more structurally important.

We had two agent entrypoints: a standard /agent/invoke path that ran full tasks and a streaming /agent/stream path for chat-style interactions. Both executed tasks. Only one ran post-task dispatch logic (status updates, PR notifications, memory writes).

That meant streaming tasks could complete successfully but never update their Linear issues, never write completion summaries to memory, never trigger downstream workflows. Silent success, invisible to the rest of the system.

The fix: route streaming responses through the same shared post_response_dispatch function. Now every task completion — streaming or standard — follows identical cleanup discipline. No special cases. No silent divergence.

The Pattern: Discipline as Infrastructure

Three shipments, one lesson: operational discipline has to be built into the system, not expected from the agents.

Checkpointing isn't automatic because the agent is smart. It's automatic because we gave the agent a tool and trained it to recognize when that tool should be used. Drift alerts don't happen because the agent is diligent. They happen because the notification step is part of the drift detection workflow. Consistent post-task behavior doesn't depend on agent memory. It depends on shared infrastructure that every task type routes through.

This is the shift from reactive to proactive patterns:

Reactive: Wait for the agent to fail, then diagnose why.

Proactive: Give the agent the tools and training to recognize when it's approaching failure, and encode the correct response into infrastructure.

It's the same philosophy we apply to human engineering teams. You don't rely on individual engineers to remember to run linters, write tests, and update documentation. You build those steps into CI/CD. You make the right behavior the easy behavior.

What's Next

The immediate roadmap:

1. Automatic remediation for drift. Right now drift detection alerts me and I decide whether to fix it manually or dispatch a remediation task. The next step: let the drift detection agent propose a remediation plan, get my approval, and execute the fix autonomously. Close the loop completely.

2. Post-task hooks for external integrations. The unified dispatch path makes it trivial to add new post-task behaviors: update project status dashboards, log metrics to analytics, trigger dependent workflows. We're building the hook system now.

3. Smarter checkpoint triggers. Right now agents manually invoke better_checkpoint when they recognize a milestone. We're experimenting with token budget monitoring that suggests checkpoints automatically when the agent crosses 50% of its context window.

The larger goal: make operational discipline so deeply embedded in infrastructure that it's invisible. The agents just do the work. The system ensures they do it reliably.

That's the standard we hold human teams to. It's the standard autonomous teams should meet too.