Skip to content

fix: avoid shared task and resource collections - #624

Merged
njzjz merged 1 commit into
deepmodeling:masterfrom
njzjz-bot:fix/issue-608-mutable-defaults
Aug 29, 2026
Merged

fix: avoid shared task and resource collections#624
njzjz merged 1 commit into
deepmodeling:masterfrom
njzjz-bot:fix/issue-608-mutable-defaults

Conversation

@njzjz-bot

Copy link
Copy Markdown
Contributor

Fixes #608

Summary

  • replace mutable Task and Resources constructor defaults with fresh collections
  • copy caller-provided task lists and resource configuration before storing or normalizing it
  • preserve nested ownership for environment and backend dictionaries
  • give the cloud zip helper a None default and guaranteed archive closure
  • add regressions for default isolation, caller mutation, strategy normalization, and archive creation

Validation

  • python -m coverage run -p --source=./dpdispatcher -m unittest (170 passed, 42 skipped)
  • python -m coverage combine && python -m coverage report (47% total)
  • pre-commit run --all-files
  • uvx ty check dpdispatcher/submission.py dpdispatcher/utils/dpcloudserver/zip_file.py --python /tmp/dpdispatcher-validation-venv/bin/python --python-version 3.13
  • dpdisp --help
  • python -m dpdispatcher -h
  • make html in doc/ (succeeded with existing warnings)
  • pyright was attempted, but its local wrapper could not provision a Node runtime; the repository's current changed-file ty check passes

Coding agent: Codex
Codex version: codex-cli 0.144.4
Model: gpt-5.6-sol
Reasoning effort: xhigh

Replace mutable constructor defaults with fresh collections, detach caller-owned task and resource configuration, and make the cloud zip helper close archives safely.

Coding-Agent: Codex
Codex-Version: codex-cli 0.144.4
Model: gpt-5.6-sol
Reasoning-Effort: xhigh
@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jul 18, 2026
@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@njzjz-bot, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 45 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d1b3ac4c-5e0b-4374-b050-d7a2f5325c2f

📥 Commits

Reviewing files that changed from the base of the PR and between e23bb8c and f2df721.

📒 Files selected for processing (5)
  • dpdispatcher/submission.py
  • dpdispatcher/utils/dpcloudserver/zip_file.py
  • tests/test_class_resources.py
  • tests/test_class_task.py
  • tests/test_dpcloudserver_zip_file.py

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.

@codecov

codecov Bot commented Jul 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.86207% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 48.64%. Comparing base (e23bb8c) to head (f2df721).

Files with missing lines Patch % Lines
dpdispatcher/utils/dpcloudserver/zip_file.py 58.82% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #624      +/-   ##
==========================================
+ Coverage   48.38%   48.64%   +0.26%     
==========================================
  Files          40       40              
  Lines        3960     3961       +1     
==========================================
+ Hits         1916     1927      +11     
+ Misses       2044     2034      -10     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@njzjz-bot njzjz-bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reviewed the constructor and serialization changes. Task/resource collections are detached from defaults and caller-owned containers, nested strategy/env/backend kwargs are copied, deserialization still fills defaults, and the zip helper closes archives reliably. The full CI matrix is green; I found no blocking issue.

This PR is authored by the reviewing account, so this is a comment review rather than a self-approval.

Review context: Codex's quota is close to resetting, so I'm deliberately spending the remaining tokens on reviewing the open PR queue now.

Coding agent: Codex
Codex version: codex-cli 0.144.6
Model: gpt-5.6-sol
Reasoning effort: xhigh

@njzjz-bot njzjz-bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No blocking findings after reviewing the full diff, related code, and CI checks. Intended decision: APPROVE. GitHub does not permit njzjz-bot to approve a pull request authored by the same account, so this formal review is submitted as COMMENT.

Coding agent: Codex
Codex version: codex-cli 0.151.0
Model: gpt-5.6-sol
Reasoning effort: xhigh

@njzjz-bot njzjz-bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reviewed the complete diff and relevant surrounding code. No blocking findings. GitHub does not permit the njzjz-bot account to approve a pull request authored by njzjz-bot, so this review is submitted with the COMMENT event only.

Coding agent: Codex
Codex version: codex-cli 0.151.0
Model: gpt-5.6-sol
Reasoning effort: xhigh

@njzjz-bot njzjz-bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Independent review result: no blocking issues found. GitHub prevents njzjz-bot from approving a pull request authored by the same account, so this formal review is submitted as COMMENT rather than APPROVE.

Coding agent: Codex
Codex version: codex-cli 0.151.0
Model: gpt-5.6-sol
Reasoning effort: xhigh

@njzjz
njzjz merged commit 9e456c3 into deepmodeling:master Aug 29, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Code scan] Avoid mutable defaults in Task and Resources

2 participants