cli: `agentcube invoke` keeps sending an expired session ID and never recovers
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Start with cmd/cli/agentcube/runtime/invoke_runtime.py, especially the saved-session logic around lines 99-102 and 198-203. Find the existing invoke runtime unit tests and follow the established SDK behavior from #460. Done means a 404 SESSION_NOT_FOUND clears the stale session_id, retries once without the session header, and is covered by unit tests.
Written by the indexing model from the issue text.
Description
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):
agentcube publishan agent, then runagentcube invoke. It works andsession_idgets written toagent_metadata.yaml.- Wait for the session to be garbage-collected (idle timeout, 15 min by default).
- Run
agentcube invokeagain. You get 404SESSION_NOT_FOUND. - Run it again. You get the same error, because
session_idis 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).
- Dominant language
- Go
- Stars
- 176
- Forks
- 95
- Avg merge
- 5d 18h
- Merged PRs (30d)
- 9
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from volcano-sh/agentcube
-
Flaky TestGetPrivateKeyPEM in pkg/router due to direct deep equal assertion on rsa.PrivateKeyPossibly taken @0xA8hinav claimed this 207 days ago. Openkind/bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
volcano-sh/agentcube#348 · 1 comment ·
Maintainers usually reply within 1 day
-
Unify Redis and Valkey store implementations in pkg/storePossibly taken @GuTS805 claimed this 1 day ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 44/100
volcano-sh/agentcube#532 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
volcano-sh/agentcube#531 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 43/100
volcano-sh/agentcube#530 ·
Maintainers usually reply within 1 day
-
workloadmanager: POST /sandbox has no per-owner rate limitingPossibly taken @SoumaCloud claimed this 21 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 10/100
volcano-sh/agentcube#513 ·
Maintainers usually reply within 1 day
All issues in volcano-sh/agentcube
Similar issues
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
rohitgollarahalli/mcpx#45 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
router-for-me/CLIProxyAPI#8851 ·
Maintainers usually reply within 7 days
-
Mend: dependency security vulnerability
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Windows 主机
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Lee-xeo/Claude-Cage#1550 ·
Maintainers usually reply within 1 day