Conversation
|
@codex Please review this pull request |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ 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
| # Create tables if they don't exist | ||
| self.sessions_table = self._db.create_table( | ||
| schema=ChatSessionDB, if_exists="overwrite" | ||
| ) | ||
| self.summaries_table = self._db.create_table( | ||
| schema=SessionSummaryDB, if_exists="overwrite" |
There was a problem hiding this comment.
Avoid recreating TiDB tables on each startup
The TiDB connection builds chat_sessions and session_summaries with create_table(..., if_exists="overwrite"), which drops any existing data every time the app process starts. That behaviour erases all previously saved conversations and summaries, defeating the “global memory” goal and contradicting the comment that tables should be created only if missing. Using a non-destructive mode (e.g. append/ignore) or checking for existence would preserve data across runs.
Useful? React with 👍 / 👎.
| # Create session manager with temporary storage | ||
| session_manager = SessionManager(storage_path=temp_dir) | ||
|
|
There was a problem hiding this comment.
Update tests to match SessionManager signature
test_session_manager constructs SessionManager(storage_path=temp_dir), but SessionManager.__init__ no longer accepts a storage_path keyword. Executing the test suite immediately raises TypeError: SessionManager() got an unexpected keyword argument 'storage_path', so none of the session tests run. The tests need to be updated for the TiDB-backed implementation or the constructor should restore the expected parameter.
Useful? React with 👍 / 👎.
No description provided.