Skip to content

dedupe bubble/composer reads through raw_access helpers#137

Merged
wpak-ai merged 2 commits into
masterfrom
refactor/raw-access-dedup
Jul 16, 2026
Merged

dedupe bubble/composer reads through raw_access helpers#137
wpak-ai merged 2 commits into
masterfrom
refactor/raw-access-dedup

Conversation

@clean6378-max-it

@clean6378-max-it clean6378-max-it commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

CLoses #129

follow-up to #133. bubble and composer properties were all doing the same optional-field dance (get key, warn on drift, return a default). this routes them through the shared helpers in raw_access.py instead.

behavior should be unchanged: same return values, same warning text. tests in test_raw_accessors.py cover wrong types on the model path and the dict-bridge path.

sanity check: pytest -k "bubble or composer or raw_access" and mypy ..

Summary by CodeRabbit

  • Bug Fixes
    • Improved robustness when loading saved conversations and messages with missing or unexpectedly formatted fields.
    • More consistent safe fallbacks for metadata, attached files, context, token counts, tool results, usage data, and related fields.
    • Enhanced diagnostics for malformed saved data so problematic fields are easier to identify during troubleshooting.

@clean6378-max-it clean6378-max-it self-assigned this Jul 16, 2026
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e35a8a78-5fd6-4f29-94cb-1d6af6e533d4

📥 Commits

Reviewing files that changed from the base of the PR and between fd91a26 and b715847.

📒 Files selected for processing (2)
  • models/conversation.py
  • models/raw_access.py
🚧 Files skipped from review as they are similar to previous changes (2)
  • models/raw_access.py
  • models/conversation.py

📝 Walkthrough

Walkthrough

Changes

The PR centralizes optional Cursor raw-field validation and fallback handling, migrates Composer and Bubble properties to shared helpers, updates bubble_context, and expands schema-drift warning tests.

Cursor raw access normalization

Layer / File(s) Summary
Shared optional field accessors
models/raw_access.py
Adds dictionary, list, and numeric accessors with absent-value defaults and wrong-type logging; bubble_context uses the dictionary accessor.
Conversation property migration
models/conversation.py
Routes Composer and Bubble optional persisted fields through the shared accessors while preserving list filtering and absent-value behavior.
Accessor drift validation
tests/test_raw_accessors.py
Checks models.raw_access warnings, raw key names, and fallback values for incorrectly typed fields.

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

Possibly related PRs

Suggested reviewers: bradjin8, wpak-ai

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title concisely describes the main refactor of routing Bubble and Composer reads through shared raw_access helpers.
Linked Issues check ✅ Passed The PR matches the linked issue by de-duplicating Bubble/Composer accessors, adding shared helpers, and covering drift warnings in tests.
Out of Scope Changes check ✅ Passed No clear out-of-scope changes are present beyond the refactor, helper additions, tests, and a minor documentation comment.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/raw-access-dedup

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

Comment thread models/conversation.py
Comment thread models/raw_access.py
Comment thread models/conversation.py
@bradjin8
bradjin8 requested a review from wpak-ai July 16, 2026 18:52
@wpak-ai
wpak-ai merged commit 92d1ff7 into master Jul 16, 2026
17 checks passed
@wpak-ai
wpak-ai deleted the refactor/raw-access-dedup branch July 16, 2026 19:41
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.

cppa-cursor-browser: de-duplicate Bubble/Composer property bodies through raw_access helpers

3 participants