Mattermost UI bridge: source filter + legacy archi_service backfill#5
Open
hassan11196 wants to merge 2 commits into
Open
Mattermost UI bridge: source filter + legacy archi_service backfill#5hassan11196 wants to merge 2 commits into
hassan11196 wants to merge 2 commits into
Conversation
8b1115f to
3d9789e
Compare
882694b to
b42786b
Compare
fdb81d4 to
28c8fc8
Compare
langgraph-prebuilt 1.0.9+ imports ExecutionInfo from langgraph.runtime,
a symbol that only exists in langgraph 1.2+. With langgraph==1.0.2
pinned (which declares langgraph-prebuilt<1.1.0), pip's resolver still
picks up langgraph-prebuilt==1.0.13 (the highest matching minor), and
the resulting environment fails to import langchain.tools.tool_node at
test collection time:
ImportError: cannot import name 'ExecutionInfo' from 'langgraph.runtime'
Pinning langgraph-prebuilt==1.0.8 (the last release before the
ExecutionInfo import was added) makes the resolved environment
self-consistent again. Mirrored in both Dockerfile requirement files
since they're build-time copies of requirements-base.txt.
PR archi-physics#543 already plumbed Mattermost conversations into the cross-source list query, surfaced archi_service in the API response, and added the sidebar badge. This PR fills the two remaining gaps: scripts/backfill_mattermost_archi_service.py Idempotent backfill for deployments that ran the Mattermost service pre-PR-543. Heuristic: any conversation_metadata row whose client_id matches 'mm_user_%' was created by ThreadContextManager and should have archi_service = 'mattermost'. Defaults to dry-run; --apply performs the UPDATE. Prints a sample of affected rows in either mode so operators can sanity-check before applying. src/interfaces/chat_app/app.py:list_conversations Accept an optional ?source=all|chat|mattermost|api query parameter. Rejects unknown values with a 400. Filters post-fetch so the existing cross-source SQL stays unchanged. Also replaces a stray print() error path with logger.error(). tests/unit/test_list_conversations_source_filter.py 10 cases covering the filter behaviour and validator. Uses a pure-Python replica of the inline filter so no Flask/Postgres is needed in CI.
28c8fc8 to
725d483
Compare
2 tasks
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.
Summary
PR archi-physics#543 already plumbed Mattermost conversations into the cross-source list query, surfaced
archi_servicein the API response, and added the sidebar badge. This PR fills the two remaining gaps so Mattermost-originated chats are fully equivalent to web chats in the UI.Changes
scripts/backfill_mattermost_archi_service.py— idempotent backfill for deployments that ran the Mattermost service pre-PR-543. Heuristic: anyconversation_metadatarow whoseclient_idmatchesmm_user_%was created byThreadContextManagerand should havearchi_service = 'mattermost'. Defaults to dry-run;--applyperforms the UPDATE. Prints a sample of affected rows in either mode so operators can sanity-check first.src/interfaces/chat_app/app.py:list_conversations— accept an optional?source=all|chat|mattermost|apiquery parameter. Rejects unknown values with 400. Filters post-fetch so the existing cross-source SQL stays unchanged. Also replaces a strayprint()error path withlogger.error().Test plan
pytest tests/unit/test_list_conversations_source_filter.py— 10/10 green locallyscripts/backfill_mattermost_archi_service.pyagainst a dev DB (dry-run first, then--apply) and confirm row countsGET /api/list_conversations?source=mattermostand confirm only Mattermost-originated rows are returnedGET /api/list_conversations?source=bogusand confirm 400