refactor: use mark_dirty() method instead of direct attribute assignment - #3
Conversation
Replaces all direct assignments to `session.history_dirty = True` with the encapsulated `session.mark_dirty()` method call to properly enforce the performance semantics documented in the Session dataclass. Co-authored-by: dharshan-X <72392459+dharshan-X@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Caution Review failedPull request was closed or merged during review 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 (6)
WalkthroughThis PR refactors session dirty-flag tracking by replacing 18 direct assignments to ChangesSession Dirty Marking Method Refactor
🎯 2 (Simple) | ⏱️ ~8 minutes
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
There was a problem hiding this comment.
Pull request overview
This PR refactors session mutation tracking by replacing direct session.history_dirty = True assignments with the encapsulated session.mark_dirty() call, aligning code usage with the Session dataclass’s documented performance semantics.
Changes:
- Replaced
session.history_dirty = Truewithsession.mark_dirty()across agent, CLI, bot, desktop bridge, and prompt-building flows. - Ensured history mutations in prompt/system directive injection and compaction paths mark the session as dirty via the method.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| prompt_builder.py | Uses session.mark_dirty() after history/system-prompt mutations (compaction, directive injection, normalization, memory merge). |
| desktop/api_bridge.py | Uses session.mark_dirty() after cancel flow mutates tool/history state. |
| cli.py | Uses session.mark_dirty() after appending tool/user-facing messages in signal handler flows. |
| bot.py | Uses session.mark_dirty() after cancel flow appends denial message and clears pending confirmations. |
| agent.py | Uses session.mark_dirty() after appending user/tool/assistant messages and tool results. |
| commit_message.txt | Adds a commit-message artifact file (not referenced elsewhere). |
| refactor: use mark_dirty() method instead of direct attribute assignment | ||
|
|
||
| Replaces all direct assignments to `session.history_dirty = True` with the encapsulated `session.mark_dirty()` method call to properly enforce the performance semantics documented in the Session dataclass. |
Replaces all direct assignments to
session.history_dirty = Truewith the encapsulatedsession.mark_dirty()method call to properly enforce the performance semantics documented in the Session dataclass. This improves encapsulation.PR created automatically by Jules for task 7680221199825390300 started by @dharshan-X
Summary by CodeRabbit