Repository navigation
fix(edit-tools): harden owner extraction, configurable resilience, and turn_refs guards - #23408
Merged
kodjima33 merged 1 commit intoOct 23, 2026
Conversation
…d turn_refs guards
This was referenced Oct 23, 2026
legacy-retire C9 (draft, deletion): remove legacy admission from v2 sync, delete legacy_fresh
#22592
Open
Git-on-my-level
added a commit
that referenced
this pull request
Oct 23, 2026
…23440) Main's backend typecheck has failed since #23408 (1c64780): seven `reportUnnecessaryIsInstance` errors (edit_tools.py 47/99/127/160, turn_refs.py 20/32/52) stop every unit shard before tests run, which blocks CI on all backend PRs (e.g. #23402, run 39993556902). Fix: keep #23408's runtime guards exactly. Widen the `configurable` parameter of the three turn_refs helpers to `Any`, and route edit_tools' four call sites through `_configurable(config: Any)`. No behavior change. Verification (m1, omi-heavy, nice 19): - `backend/scripts/typecheck.sh` (pyright 1.1.403): **0 errors** - `pytest tests/unit/test_chat_edit_tools.py`: 23 passed Failure-Class: none 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/23440?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="View guided diff" src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a> <a href="https://www.cubic.dev/action/auto-fix/pr/BasedHardware/omi/23440?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F23440&source=description" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"><img alt="Turn on auto-fix" src="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
kriegcloud
pushed a commit
to kriegcloud/omi
that referenced
this pull request
Oct 23, 2026
…ntime guards BasedHardware#23408 added defensive isinstance checks on RunnableConfig/configurable inputs; pyright (reportUnnecessaryIsInstance) rejects them against the dict/TypedDict annotations, failing every backend unit shard on main. Widen turn_refs helpers to Any and route edit_tools through a small _configurable(Any) helper so the runtime guards stay, unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #23409
Summary
Hardens
backend/utils/retrieval/tools/edit_tools.pyandbackend/utils/retrieval/turn_refs.pyagainst unhandledAttributeErrorcrashes, missing configurable dictionaries, and invalid input arguments:owner(config)safely extractsconfigurableusing(config or {}).get('configurable') or {}, preventing unhandledAttributeError: 'NoneType' object has no attribute 'get'when callers pass{"configurable": None}or uninitialized configs. It now cleanly raisesPermissionError('Authenticated owner required')as documented.initialize_turn_refs,register_record_ref, andresolve_edit_refinturn_refs.pynow guard against non-dict orNoneconfigurable inputs, preventing downstream crashes when accessing chat scopes or turn references.update_conversation,rename_person,edit_memory,delete_memory) safely normalizeconfigurablebefore invokingresolve_edit_ref.rename_personvalidatesnamebefore invoking the MCP handler, rejecting empty, whitespace-only,None, or >100 character names with a structuredinvalid_nametool error.backend/tests/unit/test_edit_tools_resilience.pywith 100% pass rate (15/15 passing).Verification
Settlement Details
923uxEC9zF4kEKPZifLn8nkSTC1k5p2AXH3tuSSRm5na