[PR #1065] [MERGED] feat(cli): resume thread enhancements #1108

Closed
opened 2026-02-16 09:18:10 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/deepagents/pull/1065
Author: @mdrxy
Created: 2/3/2026
Status: Merged
Merged: 2/4/2026
Merged by: @mdrxy

Base: masterHead: mdrxy/resume


📝 Commits (5)

📊 Changes

9 files changed (+421 additions, -19 deletions)

View changed files

📝 libs/cli/deepagents_cli/app.py (+5 -5)
📝 libs/cli/deepagents_cli/config.py (+1 -1)
📝 libs/cli/deepagents_cli/main.py (+22 -2)
📝 libs/cli/deepagents_cli/sessions.py (+93 -3)
📝 libs/cli/deepagents_cli/ui.py (+4 -4)
📝 libs/cli/deepagents_cli/widgets/approval.py (+2 -2)
📝 libs/cli/deepagents_cli/widgets/autocomplete.py (+2 -2)
📝 libs/cli/tests/unit_tests/test_args.py (+52 -0)
📝 libs/cli/tests/unit_tests/test_sessions.py (+240 -0)

📄 Description

Adds enhancements to CLI session/resume functionality:

  • Exit tooltip - Shows resume command hint after new sessions exit so users know how to resume
  • Message counts - thread listings now show message count per thread for context
    • Fixed bug where message count showed 0 even when threads had messages (caused by counting from writes table instead of checkpoint blob - with durability="exit", messages are stored only in checkpoint blob)
  • "Did you mean?" suggestions - prefix-matches invalid thread IDs against existing threads
  • Resume argument tests - unit tests for -r/--resume argument parsing

Usage

Thread listings with message counts

deepagents threads list
┏━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┓
┃ Thread ID  ┃ Agent   ┃ Messages ┃ Last Used       ┃
┡━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━┩
│ abc12345   │ agent   │       12 │ jan 15, 3:42pm  │
│ def67890   │ agent   │        5 │ jan 14, 10:15am │
└────────────┴─────────┴──────────┴─────────────────┘

Exit hint

After exiting a new session:

Resume this session with:
deepagents -r abc12345

"Did you mean?" suggestions

When resuming with invalid thread ID:

Thread 'abc' not found.

Did you mean?
  deepagents -r abc12345
  deepagents -r abcdef00

Use 'deepagents threads list' to see available threads.
Use 'deepagents -r' to resume the most recent thread.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/deepagents/pull/1065 **Author:** [@mdrxy](https://github.com/mdrxy) **Created:** 2/3/2026 **Status:** ✅ Merged **Merged:** 2/4/2026 **Merged by:** [@mdrxy](https://github.com/mdrxy) **Base:** `master` ← **Head:** `mdrxy/resume` --- ### 📝 Commits (5) - [`449df0e`](https://github.com/langchain-ai/deepagents/commit/449df0eb1251a89d0c4bce7aa2e87dd9ddfe3608) feat(cli): resume thread enhancements, export thread - [`4d64fd3`](https://github.com/langchain-ai/deepagents/commit/4d64fd31f261b2f4190068ec9e92c3ec367aaefe) cr - [`1e37df3`](https://github.com/langchain-ai/deepagents/commit/1e37df36cf9723e689898961375f60a8d07ac920) factor out export - [`d9a7f90`](https://github.com/langchain-ai/deepagents/commit/d9a7f90d2db0edcadf68aded4f78d55a53259436) standardize on `thread` terminology - [`e0344cc`](https://github.com/langchain-ai/deepagents/commit/e0344ccf94c8394033ae75c68894ba0a308d2ec5) fix thread listing ### 📊 Changes **9 files changed** (+421 additions, -19 deletions) <details> <summary>View changed files</summary> 📝 `libs/cli/deepagents_cli/app.py` (+5 -5) 📝 `libs/cli/deepagents_cli/config.py` (+1 -1) 📝 `libs/cli/deepagents_cli/main.py` (+22 -2) 📝 `libs/cli/deepagents_cli/sessions.py` (+93 -3) 📝 `libs/cli/deepagents_cli/ui.py` (+4 -4) 📝 `libs/cli/deepagents_cli/widgets/approval.py` (+2 -2) 📝 `libs/cli/deepagents_cli/widgets/autocomplete.py` (+2 -2) 📝 `libs/cli/tests/unit_tests/test_args.py` (+52 -0) 📝 `libs/cli/tests/unit_tests/test_sessions.py` (+240 -0) </details> ### 📄 Description Adds enhancements to CLI session/resume functionality: - **Exit tooltip** - Shows resume command hint after new sessions exit so users know how to resume - **Message counts** - thread listings now show message count per thread for context - **_Fixed bug_** where message count showed 0 even when threads had messages (caused by counting from writes table instead of checkpoint blob - with `durability="exit"`, messages are stored only in checkpoint blob) - **"Did you mean?" suggestions** - prefix-matches invalid thread IDs against existing threads - **Resume argument tests** - unit tests for `-r`/`--resume` argument parsing --- ## Usage ### Thread listings with message counts ```bash deepagents threads list ``` ```txt ┏━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┓ ┃ Thread ID ┃ Agent ┃ Messages ┃ Last Used ┃ ┡━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━┩ │ abc12345 │ agent │ 12 │ jan 15, 3:42pm │ │ def67890 │ agent │ 5 │ jan 14, 10:15am │ └────────────┴─────────┴──────────┴─────────────────┘ ``` ### Exit hint After exiting a new session: ```txt Resume this session with: deepagents -r abc12345 ``` ### "Did you mean?" suggestions When resuming with invalid thread ID: ```txt Thread 'abc' not found. Did you mean? deepagents -r abc12345 deepagents -r abcdef00 Use 'deepagents threads list' to see available threads. Use 'deepagents -r' to resume the most recent thread. ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 09:18:10 -05:00
yindo closed this issue 2026-02-16 09:18:10 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/deepagents#1108