refactor(backend/copilot): make session-file helper fns public to fix Pyright warnings - #12812
Conversation
… Pyright warnings _process_cli_restore → process_cli_restore _read_cli_session_from_disk → read_cli_session_from_disk Both functions are directly imported and called in sdk/transcript_test.py. Importing private (_-prefixed) symbols from outside the defining module triggers reportAttributeAccessIssue in Pyright. Making them public removes the editor warnings without changing behaviour; the functions were already module-level helpers with no reason to be private.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📜 Recent review details⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
🧰 Additional context used📓 Path-based instructions (2)autogpt_platform/backend/**/*.py📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
autogpt_platform/{backend,autogpt_libs}/**/*.py📄 CodeRabbit inference engine (AGENTS.md)
Files:
🧠 Learnings (10)📓 Common learnings📚 Learning: 2026-03-17T10:57:12.953ZApplied to files:
📚 Learning: 2026-04-15T13:44:31.808ZApplied to files:
📚 Learning: 2026-04-01T04:17:41.600ZApplied to files:
📚 Learning: 2026-02-26T17:02:22.448ZApplied to files:
📚 Learning: 2026-03-04T08:04:35.881ZApplied to files:
📚 Learning: 2026-03-05T15:42:08.207ZApplied to files:
📚 Learning: 2026-03-16T16:35:40.236ZApplied to files:
📚 Learning: 2026-03-31T15:37:38.626ZApplied to files:
📚 Learning: 2026-04-15T02:43:36.890ZApplied to files:
🔇 Additional comments (5)
WalkthroughTwo internal helper functions in the CLI session management module were renamed to public names and all references (including unit tests) were updated; no functional or signature changes were introduced. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
🔍 PR Overlap DetectionThis check compares your PR against all other open PRs targeting the same branch to detect potential merge conflicts early. 🟢 Low Risk — File Overlap OnlyThese PRs touch the same files but different sections (click to expand)
Summary: 0 conflict(s), 0 medium risk, 4 low risk (out of 4 PRs with file overlap) Auto-generated on push. Ignores: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #12812 +/- ##
==========================================
- Coverage 65.16% 65.13% -0.04%
==========================================
Files 1831 1831
Lines 135976 135976
Branches 14534 14533 -1
==========================================
- Hits 88613 88568 -45
- Misses 44645 44693 +48
+ Partials 2718 2715 -3
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
… Pyright warnings (#12812) ## Why After PR #12804 was squashed into dev, two module-level helper functions in `backend/copilot/sdk/service.py` remained private (`_`-prefixed) while being directly imported by name in `sdk/transcript_test.py`. Pyright reports `reportAttributeAccessIssue` when tests (even those excluded from CI lint) import private symbols from outside their defining module. ## What Rename two helpers to remove the underscore prefix: - `_process_cli_restore` → `process_cli_restore` - `_read_cli_session_from_disk` → `read_cli_session_from_disk` Update call sites in `service.py` and imports/calls/docstrings in `sdk/transcript_test.py`. ## How Pure rename — no logic change. Both functions were already module-level helpers with no reason to be private; the underscore was convention carried over during the refactor but they are directly unit-tested and should be public. All 66 `sdk/transcript_test.py` tests pass after the rename. ## Checklist - [x] Tests pass (`poetry run pytest backend/copilot/sdk/transcript_test.py`) - [x] No `_`-prefixed symbols imported across module boundaries - [x] No linter suppressors added
Why
After PR #12804 was squashed into dev, two module-level helper functions in
backend/copilot/sdk/service.pyremained private (_-prefixed) while being directly imported by name insdk/transcript_test.py. Pyright reportsreportAttributeAccessIssuewhen tests (even those excluded from CI lint) import private symbols from outside their defining module.What
Rename two helpers to remove the underscore prefix:
_process_cli_restore→process_cli_restore_read_cli_session_from_disk→read_cli_session_from_diskUpdate call sites in
service.pyand imports/calls/docstrings insdk/transcript_test.py.How
Pure rename — no logic change. Both functions were already module-level helpers with no reason to be private; the underscore was convention carried over during the refactor but they are directly unit-tested and should be public.
All 66
sdk/transcript_test.pytests pass after the rename.Checklist
poetry run pytest backend/copilot/sdk/transcript_test.py)_-prefixed symbols imported across module boundaries