GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — feat(mcpx): script.language setting, --language flag, ExecOptions.language (#1917) by dezren39 · Pull Request #7818 · developing-today/code Conversation
|
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 22 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Here are some automated review suggestions for this pull request.
Reviewed commit: 8fb594bb2f
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| // Python client. | ||
| clients := map[string]runner.Client{} | ||
| if runner.ScriptLanguage(req.File, req.Source) == codegen.Python.Name { | ||
| if runner.EffectiveScriptLanguage(req.File, req.Source, opts.Language) == codegen.Python.Name { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Match client selection to shebang dispatch precedence
For API or remote executions of a Python-shebang script with language: "typescript" or "javascript", EffectiveScriptLanguage returns TypeScript and skips generating the Python client. However, runner.Run gives the shebang precedence over the explicit language and still executes the script in Python. Consequently, scripts importing mcpx_client fail on a fresh work directory even though Python shebang dispatch is documented to override the language selection. Select the generated client using the same precedence as the actual interpreter dispatch.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Fixed in the shepherd pass (task 17290, lane code-b), commits fedf6b3 (fix) and 7558f39 (regression tests) on this branch.
Client selection now matches dispatch precedence: runner.ClientScriptLanguage (new, internal/runner/language.go) returns the shebang's language whenever a shebang names a known language — dispatch rank 1 runs that interpreter verbatim — and only falls back to the explicit selection (EffectiveScriptLanguage) when no shebang is in charge. execsvc.Service.Run selects the generated client with it, so a Python-shebang script with language: "typescript" is offered the Python client the dispatched run will import. The shebang half of ScriptLanguage was factored out as shebangLanguage so both rules share the one evidence read.
Regression coverage: TestClientScriptLanguage (internal/runner/python_test.go) — Python shebang + explicit typescript → python; deno shebang + explicit python → typescript; explicit selection and auto unchanged when no shebang decides.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| WorkDir: s.WorkDir, | ||
| WorkRoot: s.WorkRoot, | ||
| Runtime: firstNonEmpty(opts.Runtime, s.Limits.Runtime), | ||
| Language: opts.Language, |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Apply the configured language default to API executions
When the daemon's configuration sets script.language to python, a /v1/exec request without an explicit language still runs a shebang-less snippet as TypeScript. Server.execSettings resolves the configuration and environment, but ExecService never transfers this setting into the service, Limits has no language field, and this assignment uses only the request option. This contradicts the new setting's documented behavior that the API option overrides the configured language for one run. Propagate the configured default and resolve it before both client generation and runner dispatch, while preserving an explicit auto override.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Fixed in the shepherd pass (task 17290, lane code-b), commits fedf6b3 (fix) and 7558f39 (regression tests) on this branch.
The configured default now propagates: execsvc.Limits gained a Language field, stamped from the resolved script.language by both service builders — the daemon's ExecService() (from execSettings(), internal/daemon/routes_exec.go) and the CLI's localService (internal/cli/exec.go). Service.Run resolves effectiveLanguage = firstNonEmpty(opts.Language, s.Limits.Language) once and uses it for both client generation and the runner options, so an explicit request value wins, an explicit auto still overrides the configured default back to detection (firstNonEmpty keeps it ahead; NormalizeLanguage reads it as no selection), and a request with no language runs under the configured default.
Regression coverage: TestConfiguredLanguageAppliesToRuns (internal/execsvc/language_test.go) runs a Python-only snippet through the service with Limits.Language=python and no request language (runs as Python), and with Limits.Language=typescript plus an explicit python request (explicit wins).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| languagePref := *lang | ||
| if languagePref == "" && a.Settings().Given("script.language") { | ||
| languagePref = a.Settings().String("script.language") |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Resolve the language from the fully merged settings
With a configured preset containing ["--language=typescript"], mcpx exec --preset <name> --script-language=python '<Python snippet>' still selects TypeScript. applyPresets parses the preset into the handwritten *lang pointer first, while the explicit canonical --script-language flag updates only the resolved settings. Preferring the nonempty pointer therefore discards the explicit override for both local and remote execution, contrary to the preset precedence documented in docs/runtimes.md. Read the fully resolved script.language setting instead of preferring the potentially stale preset value.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Fixed in the shepherd pass (task 17290, lane code-b), commits fedf6b3 (fix) and 7558f39 (regression tests) on this branch.
runScript (internal/cli/commands.go) now reads the language from the fully merged settings: whenever script.language was given at any layer, the resolved setting wins over the hand-written --language pointer — a preset is parsed into that pointer before the command line runs, while an explicit --script-language is recorded in the resolved set at the flag layer, above the preset layer, so the preset value no longer discards it. A --language given on the command line itself still wins over both (detected with scanFlag on the raw args, since the final parse set the pointer after every preset ran). So mcpx exec --preset <name-with---language=typescript> --script-language=python '<snippet>' now selects Python, and --language typed directly keeps its documented precedence.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
agent-note:v1 — state: picked-up |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…gured language default, merged-settings CLI language; regression tests
8fb594b to
7558f39
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
agent-note:v1 — state: done (fixed_merged) What the shepherd pass did: rebased the single PR commit onto main 7551d09 (5 conflicted files resolved; ops.gen.ts regenerated — new OPERATION_FINGERPRINT 8560a42def; EffectExemptionPin 213→214 for the script.language exemption), then fixed all three Codex P2 findings on the reviewed commit, each replied to on its thread:
New regression tests: TestClientScriptLanguage (runner), TestConfiguredLanguageAppliesToRuns (execsvc). Suites on the laptop: internal/runner, internal/api, internal/execsvc, internal/daemon PASS; go vet clean. Pre-existing failures verified identical on clean main and left alone: internal/settings TestTheEnvironmentDocIsCurrent + TestEveryDocumentHasAChapter, internal/cli TestInlineDaemonCancelledWhileWaiting (timing). Issue #1917 remains open — this PR was its deferred explicit-language remainder, not the whole epic. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.