Skip to content

feat(cli): show session-id on exit, add resume <session-id> subcommand#218

Merged
warren618 merged 2 commits into
HKUDS:mainfrom
zwrong:pr/trace-offload
Jun 13, 2026
Merged

feat(cli): show session-id on exit, add resume <session-id> subcommand#218
warren618 merged 2 commits into
HKUDS:mainfrom
zwrong:pr/trace-offload

Conversation

@zwrong

@zwrong zwrong commented Jun 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Print session-id on CLI exit so users can locate the corresponding trace
  • Add vibe-trading resume <session-id> subcommand

Why

When troubleshooting, users need to find the trace file associated with a
session. Previously, vibe-trading CLI did not show the session-id on exit —
the only way to identify a session was to check timestamps under
agent/sessions/ and guess which folder was newly created. Printing the
session-id solves this, while vibe-trading resume also enables resuming
a session by ID.

Changes

  • feat: _interactive_loop() gains a resume_session_id parameter;
    main() routes resume <session-id> to the interactive loop;
    session-id is printed on exit
  • refactor: _build_session_history() extracted to eliminate duplicate
    logic; add TestResumeByIdDispatch (3 test cases)

Test Plan

  • Existing tests pass (3136 passed)
  • New tests added (5 resume-related tests)
  • Tested manually

Checklist

  • No changes to protected areas without prior discussion
  • No hardcoded values
  • Code follows CONTRIBUTING.md guidelines
  • Documentation updated (if user-facing change)
zwrong added 2 commits June 13, 2026 17:25
… display

Exit interactive CLI shows the session ID so users can copy-paste
`vibe-trading resume <id>` to resume later. The resume subcommand
loads a specific session by ID and enters the interactive loop with
full history — messages are persisted through the existing
_run_one_turn / _append_message path.

Signed-off-by: zwrong <1003912034@qq.com>
Simplify / Brooks-Lint follow-up:

- Extract _build_session_history() helper to eliminate the duplicated
  get_messages -> role/content filter -> _HISTORY_RETAINED_TURNS slice
  pattern from both _maybe_resume_last_session and the resume path.
- Use _extract_max_iter instead of hardcoded max_iter=50 for the resume
  dispatch so future default changes propagate consistently.
- Add TestResumeByIdDispatch (3 tests) covering the vibe-trading resume
  <session-id> CLI dispatch path — previously uncovered.

Signed-off-by: zwrong <1003912034@qq.com>
@warren618 warren618 merged commit 76f760e into HKUDS:main Jun 13, 2026
1 check passed
@zwrong zwrong deleted the pr/trace-offload branch June 14, 2026 01:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants