Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

agentop configure codex/opencode can wait on itself when an agent runs it

Abierto
#1,530 0 comentarios 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 1 día

@Alan-Cha ya está trabajando en esto.

Desde el 28/10/2026.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

Problem

agentop configure codex enable|disable (#1526) and agentop configure opencode enable|disable restart the agent's background service so it picks up the new proxy settings. If the agent itself runs that command — you ask Codex or OpenCode to "run agentop configure codex enable" — the restart targets the service handling the very turn that is running the command.

Codex. From Codex's source (0.163.0–0.164.0); not reproduced:

  1. The turn runs agentop configure codex enable and can't finish until agentop does.
  2. agentop runs codex app-server daemon restart. The daemon drains running turns before stopping, for up to its shutdown grace (60s by default, configurable to 5 minutes).
  3. The only running turn is the one waiting on agentop, so the drain waits out the whole grace.
  4. Then the daemon is force-stopped. agentop runs inside that turn and may be killed with it, before the new daemon starts. Codex can be left with no daemon until someone restarts it by hand.

OpenCode. Same shape: agentop runs opencode service restart on the service handling the session that asked. Not checked: whether OpenCode's restart waits for that session or cuts it off.

Claude Code has no background service, so there is nothing to restart and no exposure.

Today agentop has no check for being run by an agent in either integration.

Raised in

Review of #1526 (huang195), from Codex's source. Taken out of that PR so both integrations are handled the same way.

Possible approach

Detect that agentop is running as an agent's tool call. If it is, still write the settings but skip the restart, and print the restart command to run from a terminal.

  • Codex: sets CODEX_THREAD_ID in the environment of every command it runs for a turn (codex-rs/core/src/exec_env.rs). This is a one-line check.
  • OpenCode: the equivalent marker still needs to be found.

To do

  • Reproduce on Codex: ask Codex to run agentop configure codex enable with its daemon running, and record the wait and whether a daemon survives.
  • Find out what opencode service restart does to the session that triggered it.
  • Find a reliable marker for "running inside an OpenCode session".
  • Apply one behaviour to both integrations, with tests, and document it in docs/agents/codex.md and the OpenCode guide.
Lenguaje dominante
Go
Estrellas
21
Forks
43
Merge medio
13 h 32 min
PR fusionados (30 d)
256

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 rossoctl/cortex

Todos los issues de rossoctl/cortex

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.