Skip to content

Implement persistence command enhancements#7

Merged
falloficarus22 merged 1 commit intomainfrom
persistent
Feb 27, 2026
Merged

Implement persistence command enhancements#7
falloficarus22 merged 1 commit intomainfrom
persistent

Conversation

@falloficarus22
Copy link
Copy Markdown
Owner

No description provided.

@falloficarus22 falloficarus22 merged commit e08d36a into main Feb 27, 2026
@falloficarus22
Copy link
Copy Markdown
Owner Author

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e08d36a547

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +846 to +849
match self.session_store.delete(id).await {
Ok(_) => {
let msg = Message::system(&format!("Session '{}' deleted successfully.", id));
self.session.add_message(msg.clone());
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Report missing sessions as errors in /delete

The /delete handler treats every Ok(()) from SessionStore::delete as a successful deletion, but SessionStore::delete returns Ok(()) even when the target file does not exist. In practice, a mistyped or stale session ID will still show deleted successfully, which hides operator mistakes and makes it hard to trust cleanup actions.

Useful? React with 👍 / 👎.

Comment on lines +845 to +846
if let Some(id) = args.first() {
match self.session_store.delete(id).await {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Validate session IDs before deleting files

This passes raw command input directly to session_store.delete(id), and the store builds file paths by joining session_id into the base directory. Without input validation, IDs containing path segments like ../ can resolve outside the sessions folder and delete unintended .json files, so /delete should reject non-ID characters (or canonicalize/guard paths) before calling delete.

Useful? React with 👍 / 👎.

@falloficarus22
Copy link
Copy Markdown
Owner Author

@codex suggest changes

@chatgpt-codex-connector
Copy link
Copy Markdown

To use Codex here, create an environment for this repo.

@falloficarus22
Copy link
Copy Markdown
Owner Author

@codex suggest changes

@chatgpt-codex-connector
Copy link
Copy Markdown

Summary

Testing

  • cargo fmt
  • cargo test -p agent-tui persistence::tests (ran from wrong directory; no workspace Cargo.toml at repo root)
  • cargo test persistence::tests

View task →

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant