cli: `agentcube invoke` keeps sending an expired session ID and never recovers

Aperta Adatta ai principianti
#533 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@CapThunder19 ci sta già lavorando.

Dal 6/12/2026.

  • #537 di @CapThunder19 — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
cli

Direzione di ricerca

Inizia da cmd/cli/agentcube/runtime/invoke_runtime.py, in particolare dalla logica della sessione salvata intorno alle righe 99-102 e 198-203. Trova gli existing unit test di invoke runtime e segui il comportamento stabilito dell’SDK da #460. Fatto significa che un 404 SESSION_NOT_FOUND cancella il session_id obsoleto, riprova una volta senza l’intestazione della sessione ed è coperto dagli unit test.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

kind/bug

What happened:

After the first agentcube invoke, the CLI saves the session ID to agent_metadata.yaml and sends it on every later invoke. Once that session expires (15 min idle by default) and GC removes it, the router returns 404 SESSION_NOT_FOUND. The CLI doesn't clear the saved ID, so every later invoke from that workspace fails the same way:

Error invoking agent: Failed to invoke agent hello-agent: Agent returned error 404:
{"error": "sessions.agentcube.volcano.sh \"<id>\" not found", "code": "SESSION_NOT_FOUND"}

The only ways out are re-running agentcube publish (which happens to clear session_id) or editing the YAML by hand.

What you expected to happen:

On SESSION_NOT_FOUND, the CLI should drop the stale ID and start a new session, or at least clear it and tell the user. The Python SDK already does this since #460, but the CLI wasn't updated.

How to reproduce it (as minimally and precisely as possible):

  1. agentcube publish an agent, then run agentcube invoke. It works and session_id gets written to agent_metadata.yaml.
  2. Wait for the session to be garbage-collected (idle timeout, 15 min by default).
  3. Run agentcube invoke again. You get 404 SESSION_NOT_FOUND.
  4. Run it again. You get the same error, because session_id is still in the file.

Relevant code: cmd/cli/agentcube/runtime/invoke_runtime.py. Lines 99-102 always send the saved ID, and lines 198-203 only update it after a successful response.

Anything else we need to know?:

I'm happy to send a PR. The idea is to catch 404 + SESSION_NOT_FOUND, clear session_id, and retry once without the header, plus unit tests. A --new-session flag on invoke could also be useful.

Environment:

  • agentcube version: main @ 54e30e4
  • Kubernetes version: N/A (client-side bug in the CLI)
  • Others: Python 3.12. Running the CLI from source because the packaged version is missing agentcube.models (#325).
Lingua principale
Go
Stelle
176
Fork
95
Merge medio
5g 18h
PR unite (30g)
9

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di volcano-sh/agentcube

Tutte le issue di volcano-sh/agentcube

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.