Skip to content

Group-scoped conversation invites fail with "Conversation not found" #1472

Description

@paullizer

Issue

Adding the first participant to an existing group-scoped single-user conversation can fail with 404 Conversation not found, even though the owner can still open the conversation and read its history.

The reported screenshot is from the classic v1 interface. This issue covers Development/v1 only. Implement the backend fix on Development, independently of the React branch. React/v2 support and v2-specific coverage will be handled as separate work.

Steps to Reproduce

  1. Create a normal chat conversation.
  2. Use a group agent or group workspace knowledge and send a message. The conversation is classified as group-single-user, while its document remains in the regular conversations container and its messages remain in messages.
  3. Open Add participant and choose an eligible current member of that group.
  4. Confirm the invitation. The client sends POST /api/collaboration/conversations/from-group/<conversation_id>/members.

Expected Behavior

The owner can convert the conversation to a group collaborative conversation and invite an eligible group member. Existing history and metadata remain available, and the original conversation is correctly linked and hidden.

Existing ownership, current group membership, group-status, and group-member-only invitation checks must remain enforced.

Actual Behavior

ensure_group_collaboration_for_legacy_conversation() reads only cosmos_group_conversations_container. A group-scoped conversation stored in the regular cosmos_conversations_container is therefore not found, and the route returns:

{"error": "Conversation not found"}

The conversation has not necessarily been deleted. This failure occurs at the source-conversation lookup, before the invitee is evaluated.

Impact

Group-scoped chats stored in the regular conversation container cannot be shared through the v1 participant flow. This issue addresses that Development/v1 behavior only.

The defect is present on Development at 5bed5eb7 (application version 0.261.023). The precise deployed version in the original user report is unknown, so the screenshot alone does not conclusively establish the incident's cause.

Notes

Root cause and related code

  • application/single_app/functions_simplechat_operations.py: normal conversation creation writes to conversations.
  • application/single_app/functions_conversation_metadata.py: group knowledge/agent context can set chat_type to group-single-user without moving the conversation.
  • application/single_app/functions_collaboration.py: group conversion assumes group_conversations; its group-message copier assumes group_messages, and the original-source update/linkage is also group-store-specific.
  • application/single_app/route_backend_collaboration.py: maps the missing source lookup to the reported 404.
  • The v1 client routes group single-user sharing to the existing /from-group/ endpoint.

A lookup-only change is insufficient: conversion must use the matching message store, update the original source in its actual container, and preserve the source-link conventions used by shared AI processing, metadata, deletion, and retention.

Agreed scope

  • Development/v1 only: backend compatibility fix, v1/backend regression coverage, and fix documentation.
  • Support both regular conversations/messages and legacy group_conversations/group_messages storage layouts.
  • Preserve existing authorization and group-member invitation restrictions.
  • Keep the endpoint and successful response contract unchanged; no data migration or UI changes. React/v2 implementation and verification are explicitly out of scope.
  • Increment the application patch version from the current Development version when implementing.

Acceptance criteria

  • A group-scoped conversation in regular storage can be shared, with its history and metadata preserved.
  • Existing legacy group-container conversations continue to convert correctly.
  • Source messages, linkage, hiding, cache invalidation, and subsequent source cleanup use the correct storage layout.
  • Repeating an invitation against an already-converted source reuses the existing collaboration rather than copying history again.
  • Unauthorized owners, ineligible conversation scopes, non-group invitees, and disallowed group status remain rejected without mutation.
  • Truly missing conversations retain a 404, and non-not-found storage failures are not silently treated as missing data.
  • Focused regression coverage exercises actual conversion behavior rather than only checking source strings.
  • Fix documentation and functional-test headers include the implementation version and reference this issue.

Triage

Roadmap priority: P1. Roadmap size: M. Requested assignee: Paul Lizer (@paullizer). Requested label: bug. GitHub rejected the label and assignee updates with HTTP 403 (Must have admin rights to Repository), so those fields remain unapplied; the issue is currently unassigned and unlabeled. This does not block the Development/v1 code fix.

Duplicate searches found no matching issue. Related #1281 concerns a different, already-fixed failure when loading messages after sharing; #1368 concerns opening hidden conversations in the sidebar.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions