Skip to content

bug(test): chat_knowledge e2e reads un-enveloped keys — masked until #15160's 500s cleared #15172

Description

@mrveiss

Found while fixing #15160. Reported by the agent that delivered PR #15168, which deliberately did not edit this file because another change owns it.

What

autobot-backend/knowledge/chat_knowledge_system_e2e_test.py reads response bodies that the routes do not return:

  • :307 reads data["compiled"]
  • :325 reads data["context"]

Both routes return the DataResponse envelope — {"success": ..., "data": ...} — so the payload the test wants is one level down, under data.

Why it stayed invisible

The six routes this file exercises were returning HTTP 500 on every call, because of the dead module global fixed in #15160 / PR #15168. Every assertion failed at the status check, long before any body was parsed, so the envelope mismatch never got the chance to be the failure. Fixing #15160 clears the 500s and moves these two tests to a different failure — this one.

That ordering matters for whoever picks this up: do not read a red result here after PR #15168 lands as a regression from that PR. It is a pre-existing defect that #15160 was masking.

Interaction with #14979

PR #15166 converts this file to a collectible, marker-gated live-endpoint test. Depending on merge order, the file may look different by the time this is fixed — reconcile against whichever version is in Dev_new_gui rather than against the line numbers above, which were read from the pre-conversion base.

Acceptance criteria

  • Both reads go through the DataResponse envelope, matching what the routes actually return.
  • Sweep the rest of the file for the same mistake — two occurrences found by inspection is not evidence there are only two.
  • With a live stack up and PR fix(api): resolve the chat-knowledge manager on app.state, not a dead global (#15160) #15168 merged, the tests exercising those two routes pass; if any still fail, the remaining cause is named here rather than left as a red result.
  • The contrast mutation: point a read back at the un-enveloped key and show the test fails.

Refs #15160, #14979, PR #15168, PR #15166.

Activity

  1. modified the milestones: Backlog, v0.15.0 on Sep 12, 2026
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

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions