Repository navigation
[AIGTWY-4972] Consolidate CUJ helpers, fix flakes, parallelize CUJs - #1040
Merged
Merged
Conversation
david-siqi-liu
requested review from
AarushiShah-db,
lilly-luo and
rohita5l
as code owners
October 8, 2026 02:30
david-siqi-liu
force-pushed
the
david/aigtwy-4972-cuj-helpers
branch
from
October 8, 2026 02:57
c42b00d to
1118b23
Compare
david-siqi-liu
force-pushed
the
david/aigtwy-4972-cuj-helpers
branch
5 times, most recently
from
October 8, 2026 04:18
47a955a to
db43078
Compare
lilly-luo
reviewed
Oct 8, 2026
david-siqi-liu
force-pushed
the
david/aigtwy-4972-cuj-helpers
branch
from
October 8, 2026 12:43
db43078 to
c93d00d
Compare
david-siqi-liu
force-pushed
the
david/aigtwy-4972-cuj-helpers
branch
from
October 8, 2026 15:48
c93d00d to
85d2cc6
Compare
david-siqi-liu
enabled auto-merge
October 8, 2026 16:11
david-siqi-liu
force-pushed
the
david/aigtwy-4972-cuj-helpers
branch
from
October 8, 2026 18:10
85d2cc6 to
716e349
Compare
lilly-luo
reviewed
Oct 8, 2026
lilly-luo
reviewed
Oct 8, 2026
lilly-luo
reviewed
Oct 8, 2026
UG reviewThe visible patch affects CUJ authentication refresh and cleanup, shared polling and evidence helpers, per-file CI sharding, and review-bot response limits. No actionable issues were identified in the provided changes. No actionable findings.
Automated advisory review of |
lilly-luo
approved these changes
Oct 8, 2026
lilly-luo
left a comment
Collaborator
There was a problem hiding this comment.
confirmed w my ai that there are no coverage regressions, only coverage expansions 🔥
Share one copy of each CUJ helper (machine-wide revert, workspace client and bearer, permission-rejecting terminal wait, model and served-response evidence, published-config splitting, catalog pagination, SDK trace counts, MCP names, configure/model/header constants). Fix the Claude MCP receipt-key and `ug mcp list` health flakes, the CUJ 4 find-permission flake, cascading teardown leaks, and the ug-review output budget. Co-authored-by: Isaac <no-reply@databricks.com>
david-siqi-liu
force-pushed
the
david/aigtwy-4972-cuj-helpers
branch
from
October 8, 2026 18:57
716e349 to
596298f
Compare
GirishS2093
pushed a commit
to GirishS2093/unity-gateway
that referenced
this pull request
Oct 11, 2026
…atabricks#930) ## Summary Add fresh-launch journeys and dedicated CUJ7 model discovery/inference coverage. Tracks AIGTWY-4882. - Keep fresh `--workspace` file tasks and `--provider` launch checks in the Full agent suites. Provider cases consume existing services and do not perform inference. - Add five CUJ7 journeys / eight collected cases: configured Claude picker discovery, configured Codex app-server discovery, fresh scoped file tasks for both agents, and preservation of preexisting Claude OS-managed family defaults during explicit model selection. - Exercise Claude's UG-owned `--model` before `--` and native argument forwarding after it. Codex covers model flags before the separator and within native `exec`. Require completed file answers and model attribution, not just startup or routing banners. - Rebase onto databricks#1040 and reuse its shared bearer, cleanup, served-response checks, and absolute-path Claude prompts. `test_cuj7_model_discovery.py` defines `CUJ_NAME`, so automatic CI discovery runs it as `E2E CUJs · CUJ 7 · Unmanaged model discovery` without workflow changes. - Keep CUJ7 sessions function-scoped for fresh-launch coverage; the shared class fixture requires a published config, while this workspace must remain unmanaged. Preserve existing test names. No production changes, fixture provisioning, or remote configuration mutations. ## Workspace prerequisites CUJ7 is pinned to `https://dbc-14e376e8-6541.cloud.databricks.com` (workspace `7474651332480761`). It must publish no CodingAgentConfig, expose discoverable `system.ai` models, and retain `ug_e2e.models.claude_haiku`, `ug_e2e.models.claude_sonnet`, and `ug_e2e.models.gpt_luna`. The shared `UG_CUJ_SP_CLIENT_ID` / `UG_CUJ_SP_CLIENT_SECRET` identity needs workspace access, read access to config/model discovery, and use access to those services. Only a short-lived bearer reaches agent processes. Each case checks that the workspace remains unmanaged. The preservation cases seed distinct Sonnet and other-family defaults on a clean disposable runner, assert Sonnet inference and unchanged defaults, then remove that local input. ## Regression verification: before and after databricks#1037 Ran the **same post-fix component test files** (`tests/test_cli.py`, `tests/test_agent_claude.py`, and `tests/test_agent_codex.py`) against isolated source snapshots of the merged databricks#1037 fix and its immediate parent. Confirmed imports came from the intended snapshot in each run. | Source revision | Identical updated component suite | | --- | --- | | Before fix: `abf85db12d39c6c78a30b503cc0c7632d26245c6` | **957 passed, 6 failed** | | After fix (databricks#1037): `de4b119d9e8678131b0e6bd15addeb136164d72f` | **963 passed** | All four `test_unmanaged_claude_model_reaches_native_launcher` regressions (Claude/GPT IDs × separate/equals spellings) fail before the fix specifically because the native command omits `--model MODEL`; all four pass after it. The pre-fix revision's original component suite passes **959 tests**, demonstrating that the previous assertions missed this boundary. The older live explicit-model test only placed `--model` after `--`, bypassing UG's model-selection path. Coverage now includes the normal UG-owned option before the separator as well as supplemental native forwarding. **The before/after comparison is component evidence, not a live CUJ or real-inference comparison.** ## Current validation - After rebasing onto databricks#1040 and migrating helpers: **1,192 component/helper/contract tests passed**. - All **eight CUJ7 cases** collect; the CI discovery contract recognizes the file and its unique shard name. - Repository-wide Ruff checks and formatting, source type checks, and `git diff --check`: passed. - Live inference was **not run locally**: this host has `/etc/claude-code/managed-settings.json`, which can override isolated agent settings and model selection. The suite requires a clean disposable runner; CI must validate live inference and SP permissions. --------- Co-authored-by: Isaac <no-reply@databricks.com>
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.
The e2e CUJs grew one copy of each helper per journey. This consolidates the shared helpers so CUJ 7 (#930) and #1014 / #1015 can build on one version, and fixes three recurring CUJ flakes found in recent CI runs.
Shared helpers (behavior preserving; every assertion, timeout and threshold is unchanged unless listed under behavior changes):
UserSession.revert_machine_widereplaces the class teardown revert and CUJ 3's two per-test copies (same terminal names and messages).base.make_workspace_clientandbase.bearerreplace the per-CUJ client and bearer code. CUJ 6 now honoursCLIENT_ID_ENV/CLIENT_SECRET_ENV.Terminaldrives bareug(agent=), andTerminal.wait_untilis the one permission-rejecting wait for CUJ 2, 3 and 6. CUJ 1 keepsAgentTerminal.wait_for_task, which approves the read-onlyfindprompt Claude emits in CI.evidence.assert_models/assert_servedreplace CUJ 1's native-model check and the CUJ 2 / CUJ 3 served-response checks. Per-CUJ thresholds and matchers stay local.Workspace.agent_configssplits a published config by agent for CUJ 4, 5 and 6. CUJ 5 reads the config throughworkspace.config()instead of a raw GET.helpers/poll.pyis the one bounded poll for the CUJ 1 and CUJ 6 trace waits (same budgets) and theug mcp listretry. Trace SQL stays ontests/integration/utils/sql.py.helpers/mcp.py(registered_name),evidence.claude_file_task, and shared model and header constants inhelpers/constants.py.Reliability fixes:
mcp__server__tool, and on this PR's first run echoed each raw{"result": "<sha>"}tool result. The prompt names the exact keys, and the check accepts exactly those two native shapes. The receipt values and key set must still match exactly.ug mcp listhealth row (claude:failed, 1 of 13): Claude's single-shot probe raced the proxy cold start. The test polls up to 90s until the rows match, then runs the same exact assertion.findand hits a permission prompt./etcagent files still fails, and later classes now name that class and those paths instead of a generic dirty-runner error.max_output_tokens4,000 to 16,000. High-effort reasoning consumed the old budget, leaving "returned no output text". The error now includesincomplete_details.reason.CI:
E2E CUJs · <CUJ_NAME>(for exampleE2E CUJs · CUJ 3 · UC model discovery, names from the CUJ plan doc). CUJs share machine-wide/etcagent settings, so they cannot run concurrently on one runner. Each file still runs against its own read-only workspace, withfail-fast: false, andAll integration testsrequires every shard.tests/e2e_cuj/test_*.pyand reads its module-levelCUJ_NAME, so adding a CUJ needs no workflow edit (and no.github/owner approval). A file withoutCUJ_NAMEfails the plan job; a unit contract test runs the same discovery script and also enforces unique names and thetest_cuj<N>_<topic>.py/CUJ <N> ·convention.UV_HTTP_TIMEOUT=120andUV_HTTP_RETRIES=6. All of them install from PyPI at once, and one shard already failed on a metadata fetch timeout.test_cuj<N>_<topic>.py:test_cuj1_explicit_models.py(wastest_ug_managed_sentinel.py)test_cuj2_mps_mcp.py,test_cuj2_skills.pytest_cuj3_models.py(wastest_catalog_discovery.py),test_cuj3_mcp.py(wastest_mcp_registration.py),test_cuj3_skills.pytest_cuj4_smart_routing.py; CUJ 5:test_cuj5_budget_defaults.py; CUJ 6:test_cuj6_repeated_config.pyBehavior changes worth a look:
Testing:
tests/test_e2e_cuj_helpers.pyadds offline tests for the new helpers. Terminal tests run the real driver on a PTY against a fakeug.--collect-only(78 CUJ tests) pass locally. The E2E CUJs lane is the live check.CI timing, measured from job start and end times (main run 37821776097 vs this PR's run 37822258143):
Full journeys · Claude(about 13 to 15 min) is now the critical path, so cutting CUJ time further won't shorten CI.Not included: the workspace URL normalization in
src/ucodefrom AIGTWY-4972 (a product behavior change, separate PR).This pull request and its description were written by Isaac.