Setting to restore tasks at launch without resuming their agents

Abierto
#293 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 4 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
55/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
typescript
Área
tooling

Línea de trabajo

Start by reading src/store/persistence.ts and TaskAITerminal.tsx to trace how restored agents are started, then locate the store, settings, and IPC patterns for the proposed setting and live-PTY check. Add the Behavior checkbox and suspended restore path, and cover the setting-off/on cases, live-PTY reattach, persistence round trip, and Resume behavior with tests. Done means launch respects the setting while Resume and reattachment retain their described behavior.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

When Parallel Code starts, it resumes the agents of every open task. loadState creates each persisted agent with resumed: true and status: 'running', and mounting its terminal starts the agent with its resume args: claude --resume <id> or codex resume <id> when the session id is known, and otherwise the agent's resume args, such as claude --continue or codex resume --last. They all start at once.

With a dozen tasks open, a dozen agents re-enter their conversations as soon as the app opens, including the ones I'm not about to work on. The cost we noticed was with Claude Code: sessions close to their context limit compacted right after launch, several at the same time. Most of the time I open the app to work on one task. Collapsing a task keeps its agent stopped, but it also takes the task out of the layout.

Proposal

A setting under Behavior: Resume agent sessions on launch.

When it's off, restored agents are not started. Each shows "Session suspended" with the existing Resume and Restart controls, and Resume continues the conversation the same way launch does today. An agent whose process is still running (after a renderer reload, for example) reattaches as it does now, since that spawns nothing.

I'd default it to on, so nothing changes for existing users. We run it off in our fork, but that's our preference.

What a PR would contain

We've used this in our fork (miadisabelle/mia-parallel-code) since July, and it is merged onto 3.1.0. About 150 lines:

  • src/store/persistence.ts: unless the setting is on or the agent's PTY is still alive, a restored agent is created suspended (status: 'exited', signal: 'suspended') and is left out of the spawn path.
  • A ListRunningAgentIds IPC channel, so the restore can tell a live PTY from one that needs a new process before anything mounts.
  • TaskAITerminal.tsx: a suspended agent mounts neither its terminal nor its chat view, since mounting either starts it. The exit badge reads "Session suspended".
  • restartAgent and switchAgent clear the flag. The setting itself lives in the store, persistence and autosave, with a checkbox in Settings.
  • Tests: suspended when the setting is off, resumed when it's on, live-PTY reattach, the setting's round trip, and Resume clearing the flag.

Would you take a PR for this? If you'd rather solve it another way, I'll follow that.

🤖 Generated with Claude Code

Lenguaje dominante
TypeScript
Estrellas
1k
Forks
144
Merge medio
4 d 19 h
PR fusionados (30 d)
28

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de johannesjo/parallel-code

Todos los issues de johannesjo/parallel-code

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.