Skip to content

fix(memory-islands): resolve folder_id from payload metadata (regression tests + fix) - #14

Open
skorphil wants to merge 1 commit into
feat/memory-islands-modular-rewritefrom
test/memory-islands-folder-resolution
Open

fix(memory-islands): resolve folder_id from payload metadata (regression tests + fix)#14
skorphil wants to merge 1 commit into
feat/memory-islands-modular-rewritefrom
test/memory-islands-folder-resolution

Conversation

@skorphil

Copy link
Copy Markdown
Member

Fixes the reported bug where a chat inside a folder was treated as Global Workspace. Root cause: OWUI pops folder_id/chat_id out of top-level form_data into body[metadata] in /api/chat/completions. Tests lock the realistic payload shape (metadata carries IDs, top-level absent) and the fix reads metadata first with Chats-model fallback. Verified against running OWUI 0.11.0 container. Results: 5 failures before fix, 35 passed + 1 skipped after; ruff clean.

…regression tests

OWUI's /api/chat/completions handler pops folder_id and chat_id out of the
top-level form_data and re-injects them into body['metadata'] (keys
metadata.folder_id, metadata.chat_id, metadata.user_id). The filter inlet
therefore never sees top-level folder_id/chat_id, so _resolve_folder always
returned None and chats inside a folder were wrongly treated as Global
Workspace (e.g. /island-guidelines emitted the 'outside folder' guidance).

Read folder_id/chat_id from body['metadata'] first, falling back to legacy
top-level keys and the Chats model. Verified against a running OWUI 0.11.0
container: Chats.get_chat_folder_id is async.

Tests now use the real payload shape (metadata carries the IDs; top-level is
absent) and lock the resolution behavior: metadata folder_id wins, Chats-model
fallback uses metadata.chat_id, and global workspace returns None so the
command handler only emits the outside-folder guidance in that case.
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.

1 participant