test: establish Phase 0 context migration baselines#3442
Open
JasonW404 wants to merge 1 commit into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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
Behavior and risk
This PR intentionally records current behavior, including known gaps: conversation and KB lookup lack an explicit tenant parameter, and ContextManager caching is keyed only by conversation ID. These assertions are migration guards for later phases, not endorsements of those behaviors.
Risk is limited to test maintenance. Rollback is removal of the four added baseline files.
Local UT
backend/.venv/bin/pytest -q test/backend/context_baseline test/sdk/core/agents/test_agent_context/unit/test_phase0_budget_baseline.py— 22 passedtest/backend/utils/test_context_utils.py test/backend/utils/test_context_component_types.py— 179 passedtest/sdk/core/agents/test_agent_context— 243 passedgit diff --checkpassedThe repository-wide runner was also attempted with its default 20 file workers. The added Phase 0 files passed, while unrelated backend app files hit the runner's 600-second per-file timeout under resource contention; no Phase 0 assertion failed.
Functional verification
SDK / real model / Langfuse
Model:
qwen3.6-plusthrough the configured DashScope-compatible endpoint.SPEED_OK; Langfuse trace012f22b87747bb0bf91e638f2d3f1881FULL_OK; Langfuse trace238080b9272f63f17c55e45ef582ecb4Traces were inspected for model input/output, final message ordering, usage, latency, and errors.
Backend API / logs
/api/agent/run: SSE completed withfinal_answer=API_SPEED_OK/api/agent/runwith signed local JWT: identity resolved touser_id/tenant_id; SSE completed withfinal_answer=API_FULL_OKNo frontend production code is changed, so browser validation is not applicable.
Follow-up
Phase 1 will use these guards to tighten the backend-to-SDK authorized snapshot boundary and fix tenant/user/cache isolation without silently changing prompt content or ordering.