Skip to content

AIGTWY-4878 [2/3] Test catalog discovery and configured defaults - #965

Merged
tt-le merged 19 commits into
mainfrom
tt-le/aigtwy-4878-cuj3-model-tests
Oct 7, 2026
Merged

tt-le merged 19 commits into
mainfrom
tt-le/aigtwy-4878-cuj3-model-tests

Conversation

@tt-le

@tt-le tt-le commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Catalog discovery consumer, stacked on the behavior-preserving helper extraction #968. Uses the preconfigured CUJ3 workspace; provisioning #964 remains separate.

  • Require Claude's Sonnet/Haiku/Kimi set and Codex's GPT Luna/Kimi set under ug_e2e.models; exclude Gemini and ug_e2e.other_models decoys from scoped discovery and native pickers.
  • Inspect gateway catalogs and native pickers, then complete separate default and explicit-model tasks through real TUI and headless agent commands.
  • Use the shared dedicated-workspace cuj fixture, authenticated SDK client, and isolated local sessions. Catalog reads use SDK GET calls; workspace configuration remains read-only.
  • Run through the existing dedicated-cuj CI job. Remove the custom catalog lane and bespoke integration-runner mode; shared workflow and conftest match current main.

Stack

Rebased onto current main through #968. MCP registration #990 is the child consumer stack; its changes are not included here.

Validation

  • 133 focused runner/evidence/model-discovery/provider-catalog tests passed.
  • All 10 catalog cases collect; consumer Ruff lint/format and git diff --check pass.
  • No new live inference pass. Fresh SP credentials and a clean disposable runner are still required.
  • Previously observed Claude default-banner/picker failures remain unresolved; migration does not weaken those assertions.
  • Claude model evidence is response-reported; Codex evidence joins its client-selected model to the completed turn. Neither proves the gateway's backing destination.

Skills discovery remains deferred.

@tt-le
tt-le added this pull request to stack #966 October 2, 2026 17:24
@tt-le
tt-le removed this pull request from stack #966 October 2, 2026 19:37
@tt-le
tt-le changed the base branch from tt-le/aigtwy-4878-cuj3-model-fixtures to tt-le/aigtwy-4878-agent-test-helpers October 2, 2026 19:37
@tt-le
tt-le added this pull request to stack #969 October 2, 2026 19:37
@tt-le tt-le changed the title AIGTWY-4878 [2/2] Test native model discovery and configured defaults AIGTWY-4878 [2/2] Test catalog discovery and configured defaults Oct 2, 2026
@tt-le
tt-le force-pushed the tt-le/aigtwy-4878-cuj3-model-tests branch from 920af61 to 304b4f2 Compare October 5, 2026 14:46
@tt-le
tt-le force-pushed the tt-le/aigtwy-4878-cuj3-model-tests branch from 304b4f2 to 423a9e2 Compare October 5, 2026 20:08
@tt-le
tt-le marked this pull request as ready for review October 5, 2026 20:55
@tt-le
tt-le force-pushed the tt-le/aigtwy-4878-cuj3-model-tests branch from 423a9e2 to 5552c20 Compare October 6, 2026 13:44
@tt-le tt-le changed the title AIGTWY-4878 [2/2] Test catalog discovery and configured defaults AIGTWY-4878 [2/3] Test catalog discovery and configured defaults Oct 6, 2026
@david-siqi-liu david-siqi-liu added the ug-review Run the automated UG review label Oct 6, 2026
@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

UG review

This test-only change exercises scoped catalogs, native model pickers, configured defaults, and completed-task evidence. The main risk is making live CI assertions stricter than the successful agent behavior they intend to verify.

Major

  • Allow recovered inference retries — tests/e2e_cuj/test_catalog_discovery.py:134: can we accept a successful retry instead of requiring every task request to return 200, so an agent that recovers from a 429/503 doesn't fail this catalog test?

Some patches were unavailable or truncated to fit the review context. Treat this as a partial review.

Automated advisory review of c8de99811443 using Lilly's UG review rubric. It does not approve or block this PR.

@david-siqi-liu david-siqi-liu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed against main's tests/e2e_cuj/AGENTS.md (#1000) and the CUJ 3 plan in the UG Configure E2E doc.

P0

  1. Machine-wide agent files are never cleaned up. The test launches AgentTerminal five times (test_catalog_discovery.py lines 114, 160, 190, 211, 235) but never runs a terminal ug revert or checks MANAGED_PATHS. On the current head the E2E CUJs job fails all 10 tests: after the first launch, every later configure hits Non-interactive CUJ configure unexpectedly created machine-wide settings (https://github.com/databricks/unity-gateway/actions/runs/37476090218/job/112311886645). The same leftovers make #990's MCP tests error at setup with Existing machine-wide agent settings, and once this lands on main they would break any CUJ that runs after it in the shared job. #911 adds a terminal ug revert to the cuj fixture teardown, but cuj is class scoped, so this class still needs to revert, or to finish all configures before its first terminal launch.
  2. The recorder is unpacked but unused (session, workspace, _recorder = cuj, line 103), so model evidence is native records only. AGENTS.md: "Model evidence combines observed gateway requests/responses with native completed-turn records; neither routing banners nor native records alone prove an applied decision." recorder.configure_session(...) plus recorder.requests_after(checkpoint) checked against INFERENCE_PATHS and the request model covers it.
  3. AgentTerminal.wait_for_task (line 133) answers a recognized find permission prompt with Enter (tests/integration/utils/terminal.py 352-369). AGENTS.md requires rejecting unexpected permission prompts. main's helpers/terminal.py Terminal.task does that, and so does #990's _wait_for_mcp_task.
  4. Coverage: the plan's ug mcp list and ug status checks aren't in this stack (#990's body lists them as a follow-up). They don't depend on the skills blocker, so I'd include them before calling CUJ 3 covered.

The first failing test in that run also reports Unmatched or ambiguous claude picker row 'Default (recommended) Use the default model (currently Opus 5.5 (1M context)) · $4/$20 per Mtok': []. That one looks separate from the cleanup failures.

P1

  • Only the existence of exactly one published config is checked, not its contents (schema location, defaults). A read-only check on workspace.config() up front would turn a misconfigured workspace into a clear failure. #990 needs the same check, so this could be one shared helper.
  • The MCP check uses two hardcoded services instead of enumerating ug_e2e.tools, so the plan's "every MCP in ug_e2e.tools" would miss a newly added one.

Skills discovery and invocation are deferred per the PR bodies; that's the same Files API blocker CUJ 2 and CUJ 6 hit, so I'm treating it as a shared follow-up.

@tt-le
tt-le force-pushed the tt-le/aigtwy-4878-cuj3-model-tests branch 3 times, most recently from 3fac143 to f63d46e Compare October 7, 2026 05:13
@tt-le
tt-le requested a review from david-siqi-liu October 7, 2026 05:16
@tt-le
tt-le force-pushed the tt-le/aigtwy-4878-cuj3-model-tests branch from f63d46e to 88e47f1 Compare October 7, 2026 05:28

@david-siqi-liu david-siqi-liu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rechecked at 2803a02: the earlier blockers are fixed (per-test revert, recorder plus native-turn evidence, Terminal.task). All 10 catalog tests pass; the red E2E CUJs here is CUJ 2's Claude inference test, which passed on the same code in #990's run. ug status coverage stays as a follow-up in AIGTWY-4972.

Base automatically changed from tt-le/aigtwy-4878-agent-test-helpers to main October 7, 2026 12:46
@tt-le
tt-le force-pushed the tt-le/aigtwy-4878-cuj3-model-tests branch from 2803a02 to c8de998 Compare October 7, 2026 12:46
@tt-le
tt-le added this pull request to the merge queue Oct 7, 2026
Merged via the queue into main with commit 0c80d2f Oct 7, 2026
70 of 77 checks passed
@tt-le
tt-le deleted the tt-le/aigtwy-4878-cuj3-model-tests branch October 7, 2026 13:27
xsh310 pushed a commit to xsh310/ucode that referenced this pull request Oct 7, 2026
…cks#968)

## Summary
Behavior-preserving extraction only: move existing Claude/Codex answer
parsing, session paths, and child-session detection into per-agent
modules. Shared evidence callers and existing journeys retain their
behavior and names.

Removed `tests/test_integration_agent_helpers.py`: the existing public
evidence tests already cover these paths. No new model attribution,
catalog requests, HTTP helpers, picker behavior, managed-config readers,
or CUJ CI changes belong to this PR.

## Stack
Targets main; rebased onto current main. Catalog discovery databricks#965 targets
this branch, and MCP registration databricks#990 targets databricks#965. Provisioning databricks#964
remains parked separately.

## Validation
- 50 existing evidence/contract tests passed on this parent after
removal.
- `git diff --check` passed; commit/push secret scans passed.
- No live inference run.
xsh310 pushed a commit to xsh310/ucode that referenced this pull request Oct 7, 2026
…dex (databricks#990)

## Summary
Stacked on databricks#965. Adds real MCP registration, connection,
schema-exclusion, listing, and read-only tool-use journeys for Claude
and Codex in the CUJ3 workspace.

- Configure installed UG using the shared `cuj` fixture and inspect
Claude's MCP menu and Codex's `/mcp verbose` inventory.
- Require `ug_e2e.tools.fixture_reader` and `fixture_metadata` to be
connected and expose their expected tools.
- Require the bounded inventories to omit `ug_e2e.other_tools` and
`decoy_status`.
- Have each agent call both read-only tools with a fresh nonce. Verify
receipts in a completed parent assistant answer; expected receipts are
withheld from the prompt. Codex approvals are limited to the expected
server, tool, and nonce using per-call Allow.
- Check `ug mcp list` reports both managed fixtures for `claude, codex`
with aggregate `connected` status and no out-of-scope servers. Actual
Codex connectivity is established by its TUI/tool journey, not the
aggregate label.
- Use shared session/auth/terminal scaffolding and the existing
`dedicated-cuj` CI job. No MCP-specific workflow or CI-gate
contract-test changes remain.

## Known issue: ug status
`ug status` can show global `system.ai` models for Codex instead of the
managed `ug_e2e.models` catalog, and Claude's inventory can collapse to
its configured default. This affects the status model inventory; it is
separate from these native MCP inventory and tool-use checks.

The standalone production fix is databricks#1019, targeting main outside this test
stack. `ug status` CUJ coverage remains deferred; this PR does not
change status implementation or claim to test it.

## Validation
- Three MCP cases and all 13 combined catalog/MCP cases collect.
- Focused stack evidence/model-discovery/contract tests: 163 passed.
- Consumer Ruff lint/format, `git diff --check`, and stack ancestry
checks passed after restacking.
- Live passes are required to establish coverage; current results are
tracked by CI. Local live runs require credentials and a clean
disposable runner; no policy bypass is used.

## Scope
Test-only consumer: MCP CUJ, inventory helper, marker, and
documentation. Shared workflow/conftest and parent agent helpers are
unchanged in this PR. Fixtures are provisioned externally. Skills remain
deferred. No fixture scripts or credentials are committed. The unrelated
scrollable-picker README note remains uncommitted.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-assisted ug-review Run the automated UG review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants