Skip to content

bug(chat): a conversation file transferred to the knowledge base has no owner or visibility #20233

Closed

Description

@mrveiss

Problem

_to_knowledge_base in autobot-backend/conversation_file_transfer.py (PR #20213) writes the knowledge base fact with no owner_id or visibility. It fails closed as admin-only, but it is not owned by the uploader and can be pruned. It will also meet the write-path guard from #20185 when both land.

Acceptance criteria

Activity

  1. added
    bugSomething isn't working
    phase:M3.9Chat, Agents, Analytics and Settings screens
    on Oct 31, 2026
  2. mrveiss commented on Oct 31, 2026

    @mrveiss
    OwnerAuthor

    Checked on main 6b66650 (merge train PR #20245): not delivered. _to_knowledge_base in conversation_file_transfer.py sets no owner_id or visibility. The write-path guard it names (#20185) has now merged, so criterion 2 can be checked once criterion 1 lands. Both stay unticked.

  3. github-actions commented on Nov 2, 2026

    @github-actions
    Contributor

    Landed via the merge train (#20598, merge 87eae8acf8) via #20461

  4. mrveiss commented on Nov 2, 2026

    @mrveiss
    OwnerAuthor

    Verified against origin/main after the merge train (PR #20598) landed (#20461 is a member).

    AC Evidence
    Transferred fact records owner and visibility, with a test autobot-backend/conversation_file_transfer.py:63-87 _to_knowledge_base sets owner_id and visibility: ScopeLevel.PRIVATE.value, and refuses with no owner. Tests in autobot-backend/api/conversation_files_real_manager_20225_test.py assert (owner_id, visibility) == ("root", "private") and the owner id from a token user_id claim. The owner is the verified transferring principal, not the uploader, because uploaded_by can come from a request body.
    Passes the write-path guard from #20185 #20185 is merged. conversation_file_route_api.py:118-122 runs the transfer in caller_write_scope_for(principal); test_the_transfer_runs_in_a_caller_write_scope asserts the scope has role admin. The PR notes the guard returns admin metadata unchanged, so it changes nothing on this route today.

    Not covered by tests: the vector-store where clause and a real (unmocked) add_document. All listed criteria have evidence; closing is a maintainer call.

  5. mrveiss commented on Nov 2, 2026

    @mrveiss
    OwnerAuthor

    Closing: both criteria are ticked, with the evidence in the comment above, re-read from main at 655489c (conversation_file_transfer.py:64-86; conversation_files_real_manager_20225_test.py:248,266). The remaining test gap on the vector-store query moves to #20669. Entries transferred before this landed were not looked for; any backfill goes through the review queue (#17038).

  6. github-actions commented on Nov 3, 2026

    @github-actions
    Contributor

    Landed via the merge train (#20713, merge ae35848bb7) via #20668

  7. mrveiss commented on Nov 3, 2026

    @mrveiss
    OwnerAuthor

    Checked against main at merge ae35848 (the merge train, PR #20713; member #20668 (Refs)).

    AC Evidence
    A transferred fact records its owner and a visibility, with a test DELIVERED. autobot-backend/conversation_file_transfer.py _to_knowledge_base sets owner_id and visibility: ScopeLevel.PRIVATE.value, and refuses with no owner. Test: api/conversation_files_real_manager_20225_test.py (test_only_the_owner_reads_the_transferred_fact_through_the_real_search_filter)
    It passes the write-path guard from #20185, once that lands DELIVERED. #20185 is merged; test_the_transfer_runs_in_a_caller_write_scope in the same test file pins the transfer running under knowledge.write_scope. Unchanged by this merge; state stays closed
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

    backendbugSomething isn't workingphase:M3.9Chat, Agents, Analytics and Settings screens

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions