𝗠𝘆 𝗖𝗼𝗱𝗶𝗻𝗴 𝗔𝗴𝗲𝗻𝘁 𝗙𝗶𝗻𝗶𝘀𝗵𝗲𝗱 𝗧𝗵𝗲 𝗧𝗮𝘀𝗸. 𝗪𝗵𝘆 𝗗𝗶𝗱 𝗧𝗵𝗲 𝗧𝗵𝗿𝗲𝗮𝗱 𝗗𝗶𝗲?

The worst bug in a coding agent is not a crash.

It is when the first task succeeds but the next message feels like amnesia. You ask for a task. The agent finishes. Then you say: "make the button green."

To you, this is the same conversation. To the system, a completed task often means the session is over. The system starts from scratch.

While building CliGate, I realized I mixed three different layers:

These are not the same thing.

A conversation is a long-lived space for talking. A runtime session is the working thread for that conversation. A turn is one single run inside that session.

When a task completes, only the turn should end. The session must stay active.

The broken flow looks like this: User asks for a task -> Runtime session starts -> Task completes -> Conversation clears the active session -> Next follow-up starts a brand-new session.

This breaks short follow-ups like:

If the system detaches the session immediately, you must restate everything. The agent works, but the conversation feels fake.

I fixed this by making the model explicit:

I stopped treating task completion as session death. This tiny change improves the entire product feel.

In CliGate, a new session only starts if:

This matches how humans think. A user expects one chat tab to act like one ongoing thread. This is vital on mobile apps like Telegram or Feishu.

The new logic is simple:

This makes the agent feel like a coworker rather than a command launcher.

If you build coding agents, remember this: The conversation is the durable unit. The runtime session is the reusable worker. The turn is the thing that ends on success or failure.

Separa estas tres capas. Tus interacciones de seguimiento finalmente se sentirán conversacionales.

Fuente: https://dev.to/codekingai/my-coding-agent-finished-the-task-why-did-the-thread-die-2jk2

Comunidad de aprendizaje opcional: https://t.me/GyaanSetuAi