update the task information to the first step - #31
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough
ChangesDataset Metadata and Session Step Retrieval
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant GatewayStorage
participant DataManager
participant StorageStrategy
participant PersistedRecord
GatewayStorage->>DataManager: record first step with dataset
DataManager->>StorageStrategy: forward dataset
StorageStrategy->>PersistedRecord: persist dataset metadata
DataManager->>StorageStrategy: list_session_steps(session_id)
StorageStrategy->>DataManager: return ordered session steps
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
3c0f634 to
e254130
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
core/data_manager/strategy/base_strategy.py (1)
168-176: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winImplement session-step listing for SQLite.
SqliteStrategyinherits this empty default, so the newDataManager.list_session_steps()API always returns[]for the default SQLite backend. Add a SQLite override that flushes pending writes and ordersSessionSteprows bystep_id, id.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@core/data_manager/strategy/base_strategy.py` around lines 168 - 176, Implement list_session_steps in SqliteStrategy to flush pending writes, query the requested session’s SessionStep rows, and order them by step_id followed by id. Return the persisted rows in the same List[Dict[str, Any]] shape expected by DataManager.list_session_steps, while leaving the base strategy default unchanged.core/data_manager/strategy/cloud_strategy_impl.py (1)
793-799: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winExpose persisted dataset metadata in retrieval results.
datasetis stored inmeta_jsonat Line 674, but this method pops that payload and never mapsmeta["dataset"]onto the returned row. Cloud callers oflist_session_steps()therefore cannot retrieve the dataset metadata this PR records.Proposed fix
row["env_state"] = _json_object(meta.get("env_state")) row["group_id"] = meta.get("group_id") + row["dataset"] = meta.get("dataset") if row.get("is_trainable") is None:🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@core/data_manager/strategy/cloud_strategy_impl.py` around lines 793 - 799, Update the row-mapping logic in list_session_steps() to expose the persisted dataset metadata by assigning row["dataset"] from meta.get("dataset") after parsing meta_json. Preserve the existing metadata mappings and fallback behavior for all other fields.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@gateway/storage.py`:
- Around line 44-45: The completed-session tracking in _dataset_written_sessions
grows indefinitely because entries are not removed when session state is
evicted. Update the successful close and _evict_expired() handling to remove
non-pending, completed session IDs from _dataset_written_sessions once their
corresponding cache entry is released, while preserving IDs still marked
pending.
---
Outside diff comments:
In `@core/data_manager/strategy/base_strategy.py`:
- Around line 168-176: Implement list_session_steps in SqliteStrategy to flush
pending writes, query the requested session’s SessionStep rows, and order them
by step_id followed by id. Return the persisted rows in the same List[Dict[str,
Any]] shape expected by DataManager.list_session_steps, while leaving the base
strategy default unchanged.
In `@core/data_manager/strategy/cloud_strategy_impl.py`:
- Around line 793-799: Update the row-mapping logic in list_session_steps() to
expose the persisted dataset metadata by assigning row["dataset"] from
meta.get("dataset") after parsing meta_json. Preserve the existing metadata
mappings and fallback behavior for all other fields.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: e4d59552-373f-4ba4-a6a4-2da8f11a9ade
📒 Files selected for processing (5)
core/data_manager/manager.pycore/data_manager/strategy/base_strategy.pycore/data_manager/strategy/cloud_strategy_impl.pycore/data_manager/strategy/sqlite_strategy_impl.pygateway/storage.py
| self._dataset_pending_sessions: set[str] = set() | ||
| self._dataset_written_sessions: set[str] = set() |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Release completed dataset claims.
_dataset_written_sessions is never pruned, including when _evict_expired() removes the corresponding session cache entry. A long-running gateway accumulates one ID per completed session indefinitely. Clear completed, non-pending session IDs after a successful close (or use bounded TTL-based state).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@gateway/storage.py` around lines 44 - 45, The completed-session tracking in
_dataset_written_sessions grows indefinitely because entries are not removed
when session state is evicted. Update the successful close and _evict_expired()
handling to remove non-pending, completed session IDs from
_dataset_written_sessions once their corresponding cache entry is released,
while preserving IDs still marked pending.
Summary by CodeRabbit
New Features
Bug Fixes