You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Preserve JY model access for llama upgrade repair - #175
Goose repair fails with Error missing required key JIANYANG_GATEWAY_TOKEN even though JY has configured Goose and exported the job-scoped model token. Pass that token explicitly to the repair process so it can reach the configured model gateway.
The failed Actions step shows masked JIANYANG_GATEWAY_TOKEN, GOOSE_PROVIDER=custom_zai, GOOSE_MODEL=glm-5.3-flash and the job's private Goose configuration. Native patch replay reaches genuine merge conflicts, then Goose fails before making a model request.
scripts/lib/ci_process.py removes every environment variable containing TOKEN, SECRET or PASSWORD from child processes. repair() used that shared default, so its Goose child lost JIANYANG_GATEWAY_TOKEN despite retaining the configuration that references it.
A real native JY probe verified this on spark-000586, the same machine used by the failed Actions runner. Probe job job_9b3pm5dy6hh0n57, run run_pt681zv081ynnzh, succeeded with Goose 1.60.2 and the project's custom_zai / glm-5.3-flash defaults:
Filtered environment with only the gateway token restored
Exit 0; model replied SKIPPY_GOOSE_PROBE_OK
Inspect retained JY logs with jy logs job_9b3pm5dy6hh0n57. The probe prints credential-presence booleans and redacts credential values before logging captured output. It uses the failed run's immutable Skippy source, makes bounded no-tool model requests, performs no build and downloads no model weights. This is a native JY job, not a complete Actions upgrade rehearsal.
Fix
Pass JIANYANG_GATEWAY_TOKEN through the repair command's existing explicit environment override, when JY supplies it.
Leave the shared subprocess filter unchanged; ordinary build commands still lose token variables.
Keep repair timeout, permitted paths, selected upstream pin, history checks and publisher separation unchanged.
Add a real subprocess regression: its repair child must receive the model token while GITHUB_TOKEN, GH_TOKEN, JIANYANG_API_KEY and a publication secret remain absent.
Document the distinction between installed Goose and authenticated model access.
Architecture
flowchart TD
JY["JY job environment<br/>Private Goose configuration and scoped model token"] --> Prepare["Candidate preparation"]
Prepare --> Builds["Build subprocesses<br/>Existing credential filter"]
Prepare -->|Native failure| Repair["Bounded repair child<br/>Filtered environment plus job model token"]
JY -->|Explicit token override| Repair
Repair --> Gateway["JY model gateway<br/>Project-configured provider and model"]
Repair --> Candidate["Recheck and freeze candidate"]
Candidate --> CI["Existing full CI and protected publisher"]
Loading
The same helper is used by initial preparation repair and repair after CI failure. No publication credentials are added to either job.
Compatibility
No workflow routing, runner image, llama pin, native patch, ABI, API, wire or model-admission changes. A locally configured repair agent without a JY token keeps its existing environment behavior. The generic environment filter is unchanged.
The latest native patch conflicts still require an actual repair. These results establish model access, not a completed engine upgrade or model/hardware qualification.
The new regression reproduced the missing token before the fix and passed afterward. Full automation passed 81 Python tests, 58 workflow/controller tests and shell report contracts. The real JY probe above passed all three expected comparisons; its runtime was about 12 seconds. JY reported $0 compute cost; this is not a claim about upstream provider billing.
An initial probe harness attempt (job_9daavajzch712mm) stopped before Goose because it redundantly invoked jy outside that job's PATH. The successful probe uses the private Goose configuration already supplied to native JY jobs. No runner installation or credentials were changed.
No native runtime or Rust code changed, so their builds/tests were not repeated. A complete changed-pin Actions upgrade remains unverified until the fix lands and a fresh workflow run exercises repair.
Acceptance criteria
I ran the relevant local checks, or explained why they do not apply.
I agree to license my contributions under the Apache License, Version 2.0.
Summary by CodeRabbit
Documentation
Clarified that repair tasks use job-scoped model access, while build commands continue to exclude credentials and repair does not receive GitHub or publication tokens.
Bug Fixes
Repair tasks now receive the job-scoped model gateway token when available.
Tests
Added coverage verifying the repair task’s credential access and preservation of its generated patch.
No actionable comments were generated in the recent review.
Walkthrough
Repair now passes a nonempty JIANYANG_GATEWAY_TOKEN to the repair agent. A regression test checks that other specified credentials remain absent and that the agent’s patch is retained. The skill and CI documentation describe this behavior.
When JIANYANG_GATEWAY_TOKEN is nonempty, repair passes it to the repair command as an override. The regression test checks that GitHub, control-plane, and publication credentials are absent from the agent environment and verifies patch retention. The skill and CI documentation describe the token handoff and credential exclusions.
Mesh-LLM/skippy#12 — Defines the bounded repair flow and requires repair to receive no publication credentials. This change updates the repair environment while preserving that credential exclusion.
Possibly related PRs
Mesh-LLM/skippy#169 — Introduced the JY runner repair behavior that this change updates to pass the job-scoped model gateway token.
Suggested reviewers:danielwinterw, michaelneale
Merge Risk: Minimal · up to 0a6a2
Llama upgrade repair can now use the job-scoped model gateway token, while GitHub and publication credentials stay excluded. The change is small and covered by a regression test, so merge-readiness risk is minimal.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title "Preserve JY model access for llama upgrade repair" matches the main change. The PR passes JIANYANG_GATEWAY_TOKEN explicitly to the repair command so repair keeps model access, while the sha…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title "Preserve JY model access for llama upgrade repair" matches the main change. The PR passes JIANYANG_GATEWAY_TOKEN explicitly to the repair command so repair keeps model access, while the shared subprocess filter stays unchanged. The title is specific, concise, and free of file lists or vague terms.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: d5d6e1dc-d941-45de-bef1-18419e8a3c26
Commits
Reviewing files that changed from the base of the PR and between 5008074 and 0a6a267.
Files selected for processing: 4
.agents/skills/manage-ci/SKILL.md
ci/README.md
scripts/lib/upgrade_repair.py
scripts/tests/upgrade_contracts.py
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
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
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.
Original problem
Goose repair fails with
Error missing required key JIANYANG_GATEWAY_TOKENeven though JY has configured Goose and exported the job-scoped model token. Pass that token explicitly to the repair process so it can reach the configured model gateway.Tracks #12. Failed candidate job.
Diagnostics
The failed Actions step shows masked
JIANYANG_GATEWAY_TOKEN,GOOSE_PROVIDER=custom_zai,GOOSE_MODEL=glm-5.3-flashand the job's private Goose configuration. Native patch replay reaches genuine merge conflicts, then Goose fails before making a model request.scripts/lib/ci_process.pyremoves every environment variable containingTOKEN,SECRETorPASSWORDfrom child processes.repair()used that shared default, so its Goose child lostJIANYANG_GATEWAY_TOKENdespite retaining the configuration that references it.A real native JY probe verified this on
spark-000586, the same machine used by the failed Actions runner. Probe jobjob_9b3pm5dy6hh0n57, runrun_pt681zv081ynnzh, succeeded with Goose 1.60.2 and the project'scustom_zai/glm-5.3-flashdefaults:JIANYANG_GATEWAY_TOKENerrorSKIPPY_GOOSE_PROBE_OKSKIPPY_GOOSE_PROBE_OKInspect retained JY logs with
jy logs job_9b3pm5dy6hh0n57. The probe prints credential-presence booleans and redacts credential values before logging captured output. It uses the failed run's immutable Skippy source, makes bounded no-tool model requests, performs no build and downloads no model weights. This is a native JY job, not a complete Actions upgrade rehearsal.Fix
JIANYANG_GATEWAY_TOKENthrough the repair command's existing explicit environment override, when JY supplies it.GITHUB_TOKEN,GH_TOKEN,JIANYANG_API_KEYand a publication secret remain absent.Architecture
flowchart TD JY["JY job environment<br/>Private Goose configuration and scoped model token"] --> Prepare["Candidate preparation"] Prepare --> Builds["Build subprocesses<br/>Existing credential filter"] Prepare -->|Native failure| Repair["Bounded repair child<br/>Filtered environment plus job model token"] JY -->|Explicit token override| Repair Repair --> Gateway["JY model gateway<br/>Project-configured provider and model"] Repair --> Candidate["Recheck and freeze candidate"] Candidate --> CI["Existing full CI and protected publisher"]The same helper is used by initial preparation repair and repair after CI failure. No publication credentials are added to either job.
Compatibility
No workflow routing, runner image, llama pin, native patch, ABI, API, wire or model-admission changes. A locally configured repair agent without a JY token keeps its existing environment behavior. The generic environment filter is unchanged.
The latest native patch conflicts still require an actual repair. These results establish model access, not a completed engine upgrade or model/hardware qualification.
Validation
Passed locally:
PYTHONPATH=scripts python3.12 -m unittest scripts.tests.upgrade_contracts.Repair.test_repair_inherits_job_model_access_without_publication_credentials SKIPPY_PYTHON="$PWD/target/upgrade-repro/automation-venv/bin/python" just ci-automation git diff --checkThe new regression reproduced the missing token before the fix and passed afterward. Full automation passed 81 Python tests, 58 workflow/controller tests and shell report contracts. The real JY probe above passed all three expected comparisons; its runtime was about 12 seconds. JY reported $0 compute cost; this is not a claim about upstream provider billing.
An initial probe harness attempt (
job_9daavajzch712mm) stopped before Goose because it redundantly invokedjyoutside that job's PATH. The successful probe uses the private Goose configuration already supplied to native JY jobs. No runner installation or credentials were changed.No native runtime or Rust code changed, so their builds/tests were not repeated. A complete changed-pin Actions upgrade remains unverified until the fix lands and a fresh workflow run exercises repair.
Acceptance criteria
Summary by CodeRabbit