Skip to content

clean unnecessary db operation - #91

Open
BinHuangPJLAB wants to merge 2 commits into
AI45Lab:v2from
BinHuangPJLAB:db-client-enhance
Open

clean unnecessary db operation#91
BinHuangPJLAB wants to merge 2 commits into
AI45Lab:v2from
BinHuangPJLAB:db-client-enhance

Conversation

@BinHuangPJLAB

@BinHuangPJLAB BinHuangPJLAB commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features

    • Added optional filters for session steps by step ID and language model, enabling more targeted result retrieval.
  • Bug Fixes

    • Environment listings now reflect authoritative stored data and correctly apply completion filters.
    • Resume cleanup and simulation flows now target only unfinished, non-deleted environments.
    • Improved reward target lookup for gateway and database-backed session data.
  • Configuration

    • Adjusted telemetry flushing and writer settings for more efficient reporting.

@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 45060736-ed78-4442-a80e-0e3bdc84329c

📥 Commits

Reviewing files that changed from the base of the PR and between bd8d4aa and bb6b64b.

📒 Files selected for processing (1)
  • gateway/config.example.yaml

Included review availability: Your plan provides up to 2 included reviews per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The change adds session-step filters, moves environment filtering into storage queries, removes synchronous environment cache readers, and updates resume, reward, evaluation, and telemetry configuration flows.

Changes

Query filtering and resume flows

Layer / File(s) Summary
Authoritative environment queries
core/data_manager/strategy/cloud_strategy_impl.py
get_all_environments reads environment rows from the config store. list_environment_rows applies the finished filter in SQL. Synchronous cache readers are removed.
Session-step filter propagation
core/data_manager/manager.py, evaluator/reward_committer.py
list_session_steps accepts step_id and llm_model. Reward lookup passes job, step, and model filters to session-step queries.
Resume query consumers
core/data_manager/yaml_aggregator.py, manager/resume_cleanup.py, manager/simulation_flow.py
Resume flows query unfinished and non-deleted rows directly. The evaluation service no longer creates a TrajectoryReader.

Telemetry configuration

Layer / File(s) Summary
Telemetry settings
gateway/config.example.yaml
The example configuration increases the telemetry flush interval and reduces the async cloud writer count.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Suggested reviewers: hsballoon

Merge Risk: ⚪ Minimal · up to bb6b6

The change moves filtering into storage queries, updates resume and reward lookups, and reduces telemetry writer concurrency while lengthening flush intervals. No concrete merge-blocking failure is evidenced, so it is mergeable with normal checks.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 53.85% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 6 files. (1 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title describes the pull request's main goal of removing unnecessary database operations. It is concise and related to the changes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 53.85% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 6 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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