[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7351WD3MFV54JX6AS0EAMBP":3,"skill-same:01M7351WD3MFV54JX6AS0EAMBP":51},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":33,"repositoryHtmlUrl":34,"repositoryHomepageUrl":35,"ownerHtmlUrl":36,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":37,"install":38,"resources":50},"01M7351WD3MFV54JX6AS0EAMBP","delegate-to-databricks",null,"Dispatch sidecar work to Databricks-hosted LLMs.","Morrison-Lab\u002Fai-config","Morrison-Lab","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F104235520?v=4","01M734G0451S2G35MN4HFQK7XP","Morrison Lab","01M734G059BYFDFQA8YTPDGPMH",4,"MIT","https:\u002F\u002Fgithub.com\u002FMorrison-Lab\u002Fai-config\u002Fblob\u002Fmain\u002Fskills\u002Fdelegate-to-databricks\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: delegate-to-databricks\ndescription: \"Dispatch sidecar work to Databricks-hosted LLMs.\"\nuser-invocable: true\nallowed-tools:\n  - Bash\n  - Read\n  - Write\n  - Edit\n---\n\n# delegate-to-databricks --- run sidecar work on Databricks-hosted models via Codex CLI\n\nSome institutions host a foundation-model catalog behind Databricks Model Serving's OpenAI-compatible `\u002Fserving-endpoints` route, reachable independently of any VS Code extension.\nThis skill routes dispatchable sidecar work there through the **Codex CLI**, configured with Databricks as a custom `model_providers` entry, rather than through a bespoke HTTP client.\nClaude stays the orchestrator: it writes the prompt, dispatches Codex, and validates what comes back.\nThe delegation-ladder preference this plugs into lives in [`memories\u002Fdelegation.md`](..\u002F..\u002Fmemories\u002Fdelegation.md).\n[`memories\u002Fdatabricks-hosted-llms.md`](..\u002F..\u002Fmemories\u002Fdatabricks-hosted-llms.md) carries the underlying Codex\u002FDatabricks configuration facts this skill builds on --- read it alongside this file rather than only this one;\nthe two sections below repeat only what changes the setup steps.\n\n**Scope: `hac`-group projects on the UCDH GitLab only.**\nThe UCDH Databricks workspace is for projects in the `hac` group on the UCDH GitLab --- `health-analytics-core` (Health Analytics Core) on `hc2-gitlab.ucdmc.ucdavis.edu`.\nDo not dispatch work from any other project to it, including `bcs` and other UCDH projects (user directive, 2026-10-03;\nsee `memories\u002Fdelegation.md`).\n\n## Why this is a shell-out, not a subagent\n\nClaude Code's `Agent` tool takes no generic `base_url` override for an arbitrary custom endpoint --- its `model` parameter selects among Claude model tiers (e.g. `sonnet`, `opus`, `haiku`), not among backends, and which deployment route Claude Code itself talks to (the Anthropic API, or an enterprise-cloud option such as Amazon Bedrock, Google Vertex, or Microsoft Foundry) is a separate, session-level configuration that a per-call `model` value cannot redirect.\nNeither surface offers a way to point a dispatched call at a third-party model-serving endpoint, so a Databricks-hosted endpoint is unreachable from that tool directly.\nThis is the same constraint [`delegate-to-codex`](..\u002Fdelegate-to-codex\u002FSKILL.md) works around with a Bash shell-out to the Codex CLI binary.\nThis skill shells out to that same binary, but configures it with a custom `model_providers` entry instead of `delegate-to-codex`'s default OpenAI provider (a ChatGPT-account login, no `model_providers` block involved) --- same mechanism, different provider underneath it.\n\n## Why Codex CLI, not a raw HTTP wrapper or an `opencode` custom provider\n\nDatabricks' recommended interactive auth is OAuth U2M (`databricks auth login`), which mints **short-lived** access tokens by design, and PAT creation is not reliably available on every workspace (some institutions disable it on certain workspaces entirely).\nA delegation mechanism that wants a **static** API key --- `opencode`'s custom-provider config, or a hand-rolled script that caches a bearer token --- is a poor fit for that: either it needs a long-lived PAT that may not exist, or it goes stale mid-session.\n\nCodex CLI's `model_providers.\u003Cname>.auth` config table supports a **command-backed** auth source instead of a static key: `auth.command` names an external command Codex re-runs on a `refresh_interval_ms` cadence to mint a fresh token, with no secret stored in `config.toml` at all.\nThat fits a re-derive-per-call OAuth token exactly, and gets you a full agentic CLI (tool calls, sandboxing, hooks) backed by the Databricks-hosted model, not just a bare chat-completion call.\n\n## Which models are actually reachable this way\n\n**Codex CLI 0.151.0+ hard-rejects `wire_api = \"chat\"`** at config-load time (`wire_api = \"chat\" is no longer supported ... set wire_api = \"responses\"`, per [`memories\u002Fdatabricks-hosted-llms.md`](..\u002F..\u002Fmemories\u002Fdatabricks-hosted-llms.md)'s \"Codex CLI 0.151.0+ hard-rejects `wire_api = \"chat\"`\" section) --- this is not a per-model choice or a \"safer default,\" it is a hard requirement for **every** custom `model_providers` entry, Databricks-backed or otherwise.\nThat means only Databricks endpoints that actually implement the Responses route (`\u002Fserving-endpoints\u002Fresponses`) are reachable from Codex at all.\nThat same memory entry names GPT-5.5 Pro, GPT-5.5, GPT-5.3 Codex, and the GPT-5.6 family as Responses-capable, and Claude on Databricks as Chat-Completions-only and therefore currently unreachable from Codex regardless of `wire_api` --- the one model family this skill can positively rule out. (This skill's own verification run, below, confirms one specific GPT-5.6-family id, `databricks-gpt-5-6-sol`, actually works end to end --- that specific id is this skill's own finding, not the cited memory's.)\nThe memory entry does not enumerate every other family's capability, and Responses support is a vendor-catalog fact that changes over time, so **check the current supported-models\u002FResponses-capability documentation for the specific workspace before writing a profile-layer file for any model**, rather than assuming a name not listed here is either reachable or not.\n\nFor a model confirmed Chat-Completions-only on the target workspace (Claude is the one family this skill can confirm), reach it through a Chat-Completions client instead --- `opencode`'s custom provider, or a raw HTTP client --- not through this Codex-CLI route.\nNote the same auth tradeoff \"Why Codex CLI\" raises above still applies there: `opencode`'s custom-provider config wants a static API key, so this route is a good fit only where a durable PAT is actually available for the workspace;\nwhere only short-lived OAuth tokens are available, a raw HTTP client with its own token-refresh wrapper carries the same staleness problem Codex's `auth.command` solves, unsolved.\n\n## When this fires\n\n- \"delegate to databricks\", \"use databricks as a subagent\", \"dispatch to a databricks-hosted model\", \"run this on databricks\"\n- Proactively, before mechanical, bounded sidecar work when a Databricks-hosted, Responses-capable model is the destination of choice for institutional, compliance, or cost reasons, or when the ordinary `codex` (ChatGPT-plan) window from [`delegate-to-codex`](..\u002Fdelegate-to-codex\u002FSKILL.md) is exhausted but a Databricks-hosted budget is fresh.\n\n## When NOT to delegate here\n\n- Judgment-heavy, architecturally significant, or long-context synthesis work --- the same exclusion `delegate-to-codex`\u002F`delegate-to-opencode` state, for the same reason: a wrong answer from a sidecar model costs more to detect than the quota it saves.\n- The critical-path edit the rest of the work waits on --- do it inline.\n- The target model is Chat-Completions-only on Databricks (Claude is the one family confirmed so here) --- this route cannot reach it;\n  see \"Which models are actually reachable\" above, and check the current catalog for any other model not confirmed either way.\n- No `model_providers.databricks` entry is configured yet on this machine, and setting one up is itself the task (see Setup below) --- that is setup work, not a dispatch.\n- Institutional data-handling policy forbids sending this payload to the configured workspace --- check that before assuming a Databricks-hosted destination is safer than a public one merely because it is institution-operated.\n\n## Setup (one-time, per machine)\n\nFour pieces, none of which stores a long-lived secret in a config file.\nPlaceholders (`\u003CWORKSPACE_HOST>`, `\u003CPROFILE>`) stand for the specific workspace hostname and CLI profile name in use --- this skill documents the pattern, not any one institution's values.\n\n### 1. An authenticated `databricks` CLI profile (human, interactive, one-time)\n\n```bash\ndatabricks auth login --host https:\u002F\u002F\u003CWORKSPACE_HOST> --profile \u003CPROFILE>\ndatabricks auth profiles   # confirm Valid: YES\n```\n\nThis opens a browser for OAuth U2M.\n**Run this yourself, in your own terminal --- never delegate this step to an agent.**\nIt is the same category as `databricks configure --token`: an interactive credential step that needs a human at the keyboard, not a scriptable one.\n\n### 2. A token-refresh script on `PATH`\n\nA small wrapper that re-derives a fresh access token from the CLI's own credential store on every call, so nothing static is cached:\n\n```bash\n#!\u002Fusr\u002Fbin\u002Fenv bash\n# Prints a fresh Databricks OAuth access token for the given profile\n# (default: \u003CPROFILE>) to stdout. The underlying refresh token lives in the\n# OS keychain (databricks-cli's `auth_storage = secure` default) -- this\n# script never stores a secret itself, it only re-derives one on demand.\n#\n# Usage: databricks-token [profile]\nset -euo pipefail\nprofile=\"${1:-\u003CPROFILE>}\"\ndatabricks auth token --profile \"$profile\" -o json | python3 -c 'import json,sys; print(json.load(sys.stdin)[\"access_token\"])'\n```\n\nSave as `~\u002F.local\u002Fbin\u002Fdatabricks-token`, `chmod +x`.\n\n### 3. A `model_providers` entry in `~\u002F.codex\u002Fconfig.toml`\n\n```toml\n# Databricks-hosted foundation models, reached via the OpenAI-compatible\n# Responses route. Auth is command-backed rather than a static env_key: the\n# script re-derives a fresh OAuth access token from the databricks CLI's own\n# keychain-backed storage on every refresh, so no secret is stored in this\n# file. wire_api = \"responses\" is REQUIRED -- Codex CLI 0.151.0+ rejects\n# \"chat\" outright for any custom model_providers entry (see \"Which models\n# are actually reachable this way\" above).\n[model_providers.databricks]\nname = \"Databricks\"\nbase_url = \"https:\u002F\u002F\u003CWORKSPACE_HOST>\u002Fserving-endpoints\"\nwire_api = \"responses\"\n\n[model_providers.databricks.auth]\ncommand = \"\u002FUsers\u002F\u003Cyou>\u002F.local\u002Fbin\u002Fdatabricks-token\"\ntimeout_ms = 5000\nrefresh_interval_ms = 300000\n```\n\n### 4. One profile-layer file per model, under `$CODEX_HOME`\n\nCodex's `-p\u002F--profile \u003Cname>` flag layers `~\u002F.codex\u002F\u003Cname>.config.toml` on top of the base config (not the older `[profiles.\u003Cname>]` TOML-table form some Codex versions also support --- check `codex --help` for which your installed version uses).\nOne file per model you want to select by name, picking only from the Responses-capable set described above:\n\n```toml\n# ~\u002F.codex\u002Fdatabricks.config.toml\nmodel_provider = \"databricks\"\nmodel = \"databricks-\u003Cmodel-id>\"   # a Responses-capable id, e.g. databricks-gpt-5-6-sol\n```\n\nRepeat per model (e.g. `databricks-gpt-5-6-sol.config.toml`, `databricks-gpt-5-5-pro.config.toml`) so a specific one can be selected with `--profile databricks-\u003Cmodel-id>` without touching the default.\n\n## Dispatch\n\n```bash\ncodex exec --profile \u003Cprofile-name> --sandbox read-only \\\n  --skip-git-repo-check \"\u003Cprompt>\" \u003C \u002Fdev\u002Fnull\n```\n\n- `--sandbox read-only` for a review\u002Fanalysis sidecar;\n  `workspace-write` if the sidecar needs to edit files in its own scope.\n- `--skip-git-repo-check` when dispatching from a directory that is not a git repository --- Codex refuses to run outside one by default, and this flag bypasses that specific check.\n  It is unrelated to Codex's separate project-trust mechanism (`trust_level` entries under `[projects.\"\u003Cpath>\"]` in `config.toml`);\n  a directory-trust prompt needs that mechanism, not this flag.\n- `\u003C \u002Fdev\u002Fnull` (or otherwise close stdin) --- without it, Codex reads additional input from stdin before running, which hangs a non-interactive dispatch that supplies no piped input.\n- Use `codex exec --profile \u003Cname> resume`\u002F`fork` to continue a prior Databricks-backed session rather than starting fresh each time.\n\n**Verified working 2026-09-15**: `codex exec --profile databricks --sandbox read-only --skip-git-repo-check \"Reply with exactly: OK\" \u003C \u002Fdev\u002Fnull` against `databricks-gpt-5-6-sol` (a Responses-capable model) returned `OK`.\nThis ran against an already-configured, found-in-the-wild instance of the same `model_providers`\u002Fprofile-layer pattern Setup documents above, not a fresh setup built step-by-step in this verification --- so the *dispatch command and response shape* are confirmed working, while the Setup section's exact file contents are the documented pattern rather than something separately re-verified from a blank slate.\n\n## Caveats\n\n- **Codex's own model-list refresh 404s against Databricks, harmlessly.**\n  Codex periodically queries `\u003Cbase_url>\u002Fmodels` to refresh its model picker;\n  Databricks has no such endpoint (`ENDPOINT_NOT_FOUND`, \"Path must be of form \u002Fserving-endpoints\u002F\u003Cendpoint_name>\u002Finvocations or ...\u002Fserved-models\u002F\u003Cserved_model_name>\u002Finvocations\").\n  This is log noise, not a dispatch failure --- the actual `\u002Fresponses` calls the dispatch makes are unaffected.\n- **\"Model metadata ... not found.\n  Defaulting to fallback metadata\" is expected**, since Codex has no built-in profile for a `databricks-\u003Cmodel-id>` name.\n  This means Codex's own context-window budgeting for that model is a guess, not the vendor's real figure --- keep dispatched prompts modest rather than trusting an advertised window.\n- **ITPM ceilings are real and per-model-family**, and vary by workspace tier.\n  Verify the current limits for the specific model before assuming headroom, especially for a burst of concurrent tool calls in agent mode rather than one sequential request.\n- **Measured overhead**: a single-turn \"reply with OK\" dispatch through Codex against a Databricks-hosted GPT-5.6-family model consumed roughly 49,000 tokens end to end --- Codex's own agent-mode scaffolding, not the model's.\n  Budget dispatches accordingly.\n\n## Relationship to other skills\n\nCodex-side, this reuses [`delegate-to-codex`](..\u002Fdelegate-to-codex\u002FSKILL.md)'s shell-out mechanism with a different `model_providers` entry: the ordinary `codex` ChatGPT-plan window and this Databricks-hosted route are governed by separate quotas and do not substitute for each other automatically, so use this one specifically when a Databricks-hosted model is the destination of choice, not as a general Codex-availability fallback.\n\n[`delegate-to-opencode`](..\u002Fdelegate-to-opencode\u002FSKILL.md) is a **separate** CLI shell-out (the `opencode` binary, not Codex) and does not route through this mechanism at all;\nit is *a* route for a Chat-Completions-only Databricks model (see \"Which models are actually reachable this way\" above) via its own custom-provider config, subject to that section's own caveat --- it needs a durable PAT, since its config wants a static key rather than this skill's command-backed OAuth refresh.\n\n- **Do:** verify `databricks auth profiles` reports the target profile as `Valid: YES` before dispatching --- a stale or missing profile fails the token-refresh script, and thus every dispatch, with no useful message from Codex itself.\n- **Do:** treat the setup step's `databricks auth login` as a human-only, interactive, one-time action.\n- **Do:** confirm a target model is Responses-capable on the current workspace before writing a profile-layer file for it --- see \"Which models are actually reachable this way\" above.\n- **Don't:** cache a Databricks bearer token anywhere in `config.toml` or a committed file --- the whole point of the command-backed `auth.command` mechanism is that nothing static needs to be stored.\n- **Don't:** set `wire_api = \"chat\"` (or omit `wire_api`, which may default to it) on this or any custom `model_providers` entry --- current Codex CLI rejects it at config load regardless of which model the entry points at.\n","# delegate-to-databricks --- run sidecar work on Databricks-hosted models via Codex CLI\n\nSome institutions host a foundation-model catalog behind Databricks Model Serving's OpenAI-compatible `\u002Fserving-endpoints` route, reachable independently of any VS Code extension.\nThis skill routes dispatchable sidecar work there through the **Codex CLI**, configured with Databricks as a custom `model_providers` entry, rather than through a bespoke HTTP client.\nClaude stays the orchestrator: it writes the prompt, dispatches Codex, and validates what comes back.\nThe delegation-ladder preference this plugs into lives in [`memories\u002Fdelegation.md`](..\u002F..\u002Fmemories\u002Fdelegation.md).\n[`memories\u002Fdatabricks-hosted-llms.md`](..\u002F..\u002Fmemories\u002Fdatabricks-hosted-llms.md) carries the underlying Codex\u002FDatabricks configuration facts this skill builds on --- read it alongside this file rather than only this one;\nthe two sections below repeat only what changes the setup steps.\n\n**Scope: `hac`-group projects on the UCDH GitLab only.**\nThe UCDH Databricks workspace is for projects in the `hac` group on the UCDH GitLab --- `health-analytics-core` (Health Analytics Core) on `hc2-gitlab.ucdmc.ucdavis.edu`.\nDo not dispatch work from any other project to it, including `bcs` and other UCDH projects (user directive, 2026-10-03;\nsee `memories\u002Fdelegation.md`).\n\n## Why this is a shell-out, not a subagent\n\nClaude Code's `Agent` tool takes no generic `base_url` override for an arbitrary custom endpoint --- its `model` parameter selects among Claude model tiers (e.g. `sonnet`, `opus`, `haiku`), not among backends, and which deployment route Claude Code itself talks to (the Anthropic API, or an enterprise-cloud option such as Amazon Bedrock, Google Vertex, or Microsoft Foundry) is a separate, session-level configuration that a per-call `model` value cannot redirect.\nNeither surface offers a way to point a dispatched call at a third-party model-serving endpoint, so a Databricks-hosted endpoint is unreachable from that tool directly.\nThis is the same constraint [`delegate-to-codex`](..\u002Fdelegate-to-codex\u002FSKILL.md) works around with a Bash shell-out to the Codex CLI binary.\nThis skill shells out to that same binary, but configures it with a custom `model_providers` entry instead of `delegate-to-codex`'s default OpenAI provider (a ChatGPT-account login, no `model_providers` block involved) --- same mechanism, different provider underneath it.\n\n## Why Codex CLI, not a raw HTTP wrapper or an `opencode` custom provider\n\nDatabricks' recommended interactive auth is OAuth U2M (`databricks auth login`), which mints **short-lived** access tokens by design, and PAT creation is not reliably available on every workspace (some institutions disable it on certain workspaces entirely).\nA delegation mechanism that wants a **static** API key --- `opencode`'s custom-provider config, or a hand-rolled script that caches a bearer token --- is a poor fit for that: either it needs a long-lived PAT that may not exist, or it goes stale mid-session.\n\nCodex CLI's `model_providers.\u003Cname>.auth` config table supports a **command-backed** auth source instead of a static key: `auth.command` names an external command Codex re-runs on a `refresh_interval_ms` cadence to mint a fresh token, with no secret stored in `config.toml` at all.\nThat fits a re-derive-per-call OAuth token exactly, and gets you a full agentic CLI (tool calls, sandboxing, hooks) backed by the Databricks-hosted model, not just a bare chat-completion call.\n\n## Which models are actually reachable this way\n\n**Codex CLI 0.151.0+ hard-rejects `wire_api = \"chat\"`** at config-load time (`wire_api = \"chat\" is no longer supported ... set wire_api = \"responses\"`, per [`memories\u002Fdatabricks-hosted-llms.md`](..\u002F..\u002Fmemories\u002Fdatabricks-hosted-llms.md)'s \"Codex CLI 0.151.0+ hard-rejects `wire_api = \"chat\"`\" section) --- this is not a per-model choice or a \"safer default,\" it is a hard requirement for **every** custom `model_providers` entry, Databricks-backed or otherwise.\nThat means only Databricks endpoints that actually implement the Responses route (`\u002Fserving-endpoints\u002Fresponses`) are reachable from Codex at all.\nThat same memory entry names GPT-5.5 Pro, GPT-5.5, GPT-5.3 Codex, and the GPT-5.6 family as Responses-capable, and Claude on Databricks as Chat-Completions-only and therefore currently unreachable from Codex regardless of `wire_api` --- the one model family this skill can positively rule out. (This skill's own verification run, below, confirms one specific GPT-5.6-family id, `databricks-gpt-5-6-sol`, actually works end to end --- that specific id is this skill's own finding, not the cited memory's.)\nThe memory entry does not enumerate every other family's capability, and Responses support is a vendor-catalog fact that changes over time, so **check the current supported-models\u002FResponses-capability documentation for the specific workspace before writing a profile-layer file for any model**, rather than assuming a name not listed here is either reachable or not.\n\nFor a model confirmed Chat-Completions-only on the target workspace (Claude is the one family this skill can confirm), reach it through a Chat-Completions client instead --- `opencode`'s custom provider, or a raw HTTP client --- not through this Codex-CLI route.\nNote the same auth tradeoff \"Why Codex CLI\" raises above still applies there: `opencode`'s custom-provider config wants a static API key, so this route is a good fit only where a durable PAT is actually available for the workspace;\nwhere only short-lived OAuth tokens are available, a raw HTTP client with its own token-refresh wrapper carries the same staleness problem Codex's `auth.command` solves, unsolved.\n\n## When this fires\n\n- \"delegate to databricks\", \"use databricks as a subagent\", \"dispatch to a databricks-hosted model\", \"run this on databricks\"\n- Proactively, before mechanical, bounded sidecar work when a Databricks-hosted, Responses-capable model is the destination of choice for institutional, compliance, or cost reasons, or when the ordinary `codex` (ChatGPT-plan) window from [`delegate-to-codex`](..\u002Fdelegate-to-codex\u002FSKILL.md) is exhausted but a Databricks-hosted budget is fresh.\n\n## When NOT to delegate here\n\n- Judgment-heavy, architecturally significant, or long-context synthesis work --- the same exclusion `delegate-to-codex`\u002F`delegate-to-opencode` state, for the same reason: a wrong answer from a sidecar model costs more to detect than the quota it saves.\n- The critical-path edit the rest of the work waits on --- do it inline.\n- The target model is Chat-Completions-only on Databricks (Claude is the one family confirmed so here) --- this route cannot reach it;\n  see \"Which models are actually reachable\" above, and check the current catalog for any other model not confirmed either way.\n- No `model_providers.databricks` entry is configured yet on this machine, and setting one up is itself the task (see Setup below) --- that is setup work, not a dispatch.\n- Institutional data-handling policy forbids sending this payload to the configured workspace --- check that before assuming a Databricks-hosted destination is safer than a public one merely because it is institution-operated.\n\n## Setup (one-time, per machine)\n\nFour pieces, none of which stores a long-lived secret in a config file.\nPlaceholders (`\u003CWORKSPACE_HOST>`, `\u003CPROFILE>`) stand for the specific workspace hostname and CLI profile name in use --- this skill documents the pattern, not any one institution's values.\n\n### 1. An authenticated `databricks` CLI profile (human, interactive, one-time)\n\n```bash\ndatabricks auth login --host https:\u002F\u002F\u003CWORKSPACE_HOST> --profile \u003CPROFILE>\ndatabricks auth profiles   # confirm Valid: YES\n```\n\nThis opens a browser for OAuth U2M.\n**Run this yourself, in your own terminal --- never delegate this step to an agent.**\nIt is the same category as `databricks configure --token`: an interactive credential step that needs a human at the keyboard, not a scriptable one.\n\n### 2. A token-refresh script on `PATH`\n\nA small wrapper that re-derives a fresh access token from the CLI's own credential store on every call, so nothing static is cached:\n\n```bash\n#!\u002Fusr\u002Fbin\u002Fenv bash\n# Prints a fresh Databricks OAuth access token for the given profile\n# (default: \u003CPROFILE>) to stdout. The underlying refresh token lives in the\n# OS keychain (databricks-cli's `auth_storage = secure` default) -- this\n# script never stores a secret itself, it only re-derives one on demand.\n#\n# Usage: databricks-token [profile]\nset -euo pipefail\nprofile=\"${1:-\u003CPROFILE>}\"\ndatabricks auth token --profile \"$profile\" -o json | python3 -c 'import json,sys; print(json.load(sys.stdin)[\"access_token\"])'\n```\n\nSave as `~\u002F.local\u002Fbin\u002Fdatabricks-token`, `chmod +x`.\n\n### 3. A `model_providers` entry in `~\u002F.codex\u002Fconfig.toml`\n\n```toml\n# Databricks-hosted foundation models, reached via the OpenAI-compatible\n# Responses route. Auth is command-backed rather than a static env_key: the\n# script re-derives a fresh OAuth access token from the databricks CLI's own\n# keychain-backed storage on every refresh, so no secret is stored in this\n# file. wire_api = \"responses\" is REQUIRED -- Codex CLI 0.151.0+ rejects\n# \"chat\" outright for any custom model_providers entry (see \"Which models\n# are actually reachable this way\" above).\n[model_providers.databricks]\nname = \"Databricks\"\nbase_url = \"https:\u002F\u002F\u003CWORKSPACE_HOST>\u002Fserving-endpoints\"\nwire_api = \"responses\"\n\n[model_providers.databricks.auth]\ncommand = \"\u002FUsers\u002F\u003Cyou>\u002F.local\u002Fbin\u002Fdatabricks-token\"\ntimeout_ms = 5000\nrefresh_interval_ms = 300000\n```\n\n### 4. One profile-layer file per model, under `$CODEX_HOME`\n\nCodex's `-p\u002F--profile \u003Cname>` flag layers `~\u002F.codex\u002F\u003Cname>.config.toml` on top of the base config (not the older `[profiles.\u003Cname>]` TOML-table form some Codex versions also support --- check `codex --help` for which your installed version uses).\nOne file per model you want to select by name, picking only from the Responses-capable set described above:\n\n```toml\n# ~\u002F.codex\u002Fdatabricks.config.toml\nmodel_provider = \"databricks\"\nmodel = \"databricks-\u003Cmodel-id>\"   # a Responses-capable id, e.g. databricks-gpt-5-6-sol\n```\n\nRepeat per model (e.g. `databricks-gpt-5-6-sol.config.toml`, `databricks-gpt-5-5-pro.config.toml`) so a specific one can be selected with `--profile databricks-\u003Cmodel-id>` without touching the default.\n\n## Dispatch\n\n```bash\ncodex exec --profile \u003Cprofile-name> --sandbox read-only \\\n  --skip-git-repo-check \"\u003Cprompt>\" \u003C \u002Fdev\u002Fnull\n```\n\n- `--sandbox read-only` for a review\u002Fanalysis sidecar;\n  `workspace-write` if the sidecar needs to edit files in its own scope.\n- `--skip-git-repo-check` when dispatching from a directory that is not a git repository --- Codex refuses to run outside one by default, and this flag bypasses that specific check.\n  It is unrelated to Codex's separate project-trust mechanism (`trust_level` entries under `[projects.\"\u003Cpath>\"]` in `config.toml`);\n  a directory-trust prompt needs that mechanism, not this flag.\n- `\u003C \u002Fdev\u002Fnull` (or otherwise close stdin) --- without it, Codex reads additional input from stdin before running, which hangs a non-interactive dispatch that supplies no piped input.\n- Use `codex exec --profile \u003Cname> resume`\u002F`fork` to continue a prior Databricks-backed session rather than starting fresh each time.\n\n**Verified working 2026-09-15**: `codex exec --profile databricks --sandbox read-only --skip-git-repo-check \"Reply with exactly: OK\" \u003C \u002Fdev\u002Fnull` against `databricks-gpt-5-6-sol` (a Responses-capable model) returned `OK`.\nThis ran against an already-configured, found-in-the-wild instance of the same `model_providers`\u002Fprofile-layer pattern Setup documents above, not a fresh setup built step-by-step in this verification --- so the *dispatch command and response shape* are confirmed working, while the Setup section's exact file contents are the documented pattern rather than something separately re-verified from a blank slate.\n\n## Caveats\n\n- **Codex's own model-list refresh 404s against Databricks, harmlessly.**\n  Codex periodically queries `\u003Cbase_url>\u002Fmodels` to refresh its model picker;\n  Databricks has no such endpoint (`ENDPOINT_NOT_FOUND`, \"Path must be of form \u002Fserving-endpoints\u002F\u003Cendpoint_name>\u002Finvocations or ...\u002Fserved-models\u002F\u003Cserved_model_name>\u002Finvocations\").\n  This is log noise, not a dispatch failure --- the actual `\u002Fresponses` calls the dispatch makes are unaffected.\n- **\"Model metadata ... not found.\n  Defaulting to fallback metadata\" is expected**, since Codex has no built-in profile for a `databricks-\u003Cmodel-id>` name.\n  This means Codex's own context-window budgeting for that model is a guess, not the vendor's real figure --- keep dispatched prompts modest rather than trusting an advertised window.\n- **ITPM ceilings are real and per-model-family**, and vary by workspace tier.\n  Verify the current limits for the specific model before assuming headroom, especially for a burst of concurrent tool calls in agent mode rather than one sequential request.\n- **Measured overhead**: a single-turn \"reply with OK\" dispatch through Codex against a Databricks-hosted GPT-5.6-family model consumed roughly 49,000 tokens end to end --- Codex's own agent-mode scaffolding, not the model's.\n  Budget dispatches accordingly.\n\n## Relationship to other skills\n\nCodex-side, this reuses [`delegate-to-codex`](..\u002Fdelegate-to-codex\u002FSKILL.md)'s shell-out mechanism with a different `model_providers` entry: the ordinary `codex` ChatGPT-plan window and this Databricks-hosted route are governed by separate quotas and do not substitute for each other automatically, so use this one specifically when a Databricks-hosted model is the destination of choice, not as a general Codex-availability fallback.\n\n[`delegate-to-opencode`](..\u002Fdelegate-to-opencode\u002FSKILL.md) is a **separate** CLI shell-out (the `opencode` binary, not Codex) and does not route through this mechanism at all;\nit is *a* route for a Chat-Completions-only Databricks model (see \"Which models are actually reachable this way\" above) via its own custom-provider config, subject to that section's own caveat --- it needs a durable PAT, since its config wants a static key rather than this skill's command-backed OAuth refresh.\n\n- **Do:** verify `databricks auth profiles` reports the target profile as `Valid: YES` before dispatching --- a stale or missing profile fails the token-refresh script, and thus every dispatch, with no useful message from Codex itself.\n- **Do:** treat the setup step's `databricks auth login` as a human-only, interactive, one-time action.\n- **Do:** confirm a target model is Responses-capable on the current workspace before writing a profile-layer file for it --- see \"Which models are actually reachable this way\" above.\n- **Don't:** cache a Databricks bearer token anywhere in `config.toml` or a committed file --- the whole point of the command-backed `auth.command` mechanism is that nothing static needs to be stored.\n- **Don't:** set `wire_api = \"chat\"` (or omit `wire_api`, which may default to it) on this or any custom `model_providers` entry --- current Codex CLI rejects it at config load regardless of which model the entry points at.\n",{"name":5,"description":7,"allowed-tools":24,"user-invocable":29},[25,26,27,28],"Bash","Read","Write","Edit",true,"main","0f720481f8ce3b3d9fef485f6e230d8b3035748e","skills\u002Fdelegate-to-databricks",1,"https:\u002F\u002Fgithub.com\u002FMorrison-Lab\u002Fai-config","https:\u002F\u002Fmorrison-lab.github.io\u002Fai-config\u002F","https:\u002F\u002Fgithub.com\u002FMorrison-Lab","2026-11-15 04:39:15",{"source":8,"skillName":5,"commands":39,"prompt":49,"zipAvailable":29},[40,43,46],{"tool":41,"command":42},"npx","npx skills add Morrison-Lab\u002Fai-config --skill delegate-to-databricks",{"tool":44,"command":45},"bunx","bunx skills add Morrison-Lab\u002Fai-config --skill delegate-to-databricks",{"tool":47,"command":48},"pnpm","pnpm dlx skills add Morrison-Lab\u002Fai-config --skill delegate-to-databricks","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMorrison-Lab\u002Fai-config\u002Fblob\u002Fmain\u002Fskills\u002Fdelegate-to-databricks\u002FSKILL.md",[],[52,59,66,73,80,87],{"skillNo":53,"name":54,"nameZh":6,"description":55,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":58,"publishedAt":19},"01M735BVYCGR5VEC65AFDVSNKW","wrap-up","End-of-session verification and UMS.","https:\u002F\u002Fgithub.com\u002FMorrison-Lab\u002Fai-config\u002Fblob\u002Fmain\u002Fskills\u002Fwrap-up\u002FSKILL.md",[],[],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":19},"01M735BTH469T1CQ8G2Q9GENCR","workaround-watcher","Watch upstream issue for fix.","https:\u002F\u002Fgithub.com\u002FMorrison-Lab\u002Fai-config\u002Fblob\u002Fmain\u002Fskills\u002Fworkaround-watcher\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":19},"01M735BRKZWFANSQ0GM380B4TD","wn","→ whats-next.","https:\u002F\u002Fgithub.com\u002FMorrison-Lab\u002Fai-config\u002Fblob\u002Fmain\u002Fskills\u002Fwn\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M735BPE9V830B3B6NGXQ56J6","whats-next","Recommend concrete next step or action.","https:\u002F\u002Fgithub.com\u002FMorrison-Lab\u002Fai-config\u002Fblob\u002Fmain\u002Fskills\u002Fwhats-next\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M735BMHQ60EAD5B7QAWXC5A0","wait-for-results","Wait for pipeline\u002FCI results.","https:\u002F\u002Fgithub.com\u002FMorrison-Lab\u002Fai-config\u002Fblob\u002Fmain\u002Fskills\u002Fwait-for-results\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":19},"01M735BKGZHPN1PEMJ7YBD5VJ8","wai","→ send-notes.","https:\u002F\u002Fgithub.com\u002FMorrison-Lab\u002Fai-config\u002Fblob\u002Fmain\u002Fskills\u002Fwai\u002FSKILL.md",[],[]]