Skip to content

Derive UG_ENABLE_MODEL_DISCOVERY from managed MPS - #694

Open
andy-xu-db wants to merge 3 commits into
mainfrom
stack/codex/model-discovery-flag
Open

andy-xu-db wants to merge 3 commits into
mainfrom
stack/codex/model-discovery-flag

Conversation

@andy-xu-db

@andy-xu-db andy-xu-db commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

Stack

Summary

  • Set UG_ENABLE_MODEL_DISCOVERY=1 for the selected agent's managed MPS.
  • Set it to 0 otherwise.
  • Reject source flags when managed MPS owns routing.
  • Scope the variable to the child launch.
  • Add no managed-config field.

Reference

Test

  • 444 focused tests passed.
  • Ruff and format checks passed.

Testing using this workspace config:
Screenshot 2026-09-17 at 10 42 08 AM

@andy-xu-db
andy-xu-db force-pushed the stack/codex/model-discovery-flag branch 2 times, most recently from 6676365 to 5373122 Compare September 16, 2026 22:54
@andy-xu-db andy-xu-db changed the title Define UG_ENABLE_MODEL_DISCOVERY policy Resolve UG_ENABLE_MODEL_DISCOVERY from managed config Sep 16, 2026
@andy-xu-db
andy-xu-db force-pushed the stack/codex/model-discovery-flag branch from 5373122 to 87312dc Compare September 17, 2026 02:23
@andy-xu-db andy-xu-db changed the title Resolve UG_ENABLE_MODEL_DISCOVERY from managed config Derive UG_ENABLE_MODEL_DISCOVERY from managed MPS Sep 17, 2026
Comment thread src/ucode/cli.py Outdated
Comment on lines +2210 to +2219
if managed_provider and explicit_provider is not None:
raise RuntimeError(
f"--provider cannot be used for {TOOL_SPECS[tool]['display']} because your admin "
f"has configured managed provider {managed_provider}."
)
if managed_provider and parent_schema is not None:
raise RuntimeError(
f"--model-location cannot be used for {TOOL_SPECS[tool]['display']} because your "
f"admin has configured managed provider {managed_provider}."
)

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.

can you nest this a lil bit?

if managed_provider:
   if explicit_provider is not None:
       xxx
   if parent_schema is not None:
       yyyy

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

changed to nested structure

Comment thread src/ucode/cli.py
Comment on lines +2220 to +2221
if parent_schema is not None:
provider = None

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.

add a comment saying that this should not be possible configuration on the admin config

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

added comment

Comment thread tests/test_cli.py

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.

can u do an audit of these tests and make sure they're all adding value? a lot of monkey patch becomes...less valuable

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

removed excessive tests

@andy-xu-db
andy-xu-db force-pushed the stack/codex/model-discovery-flag branch from cf5e1d1 to a3b48e9 Compare September 17, 2026 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants