Skip to content

Preserve JY model access for llama upgrade repair - #175

Merged
i386 merged 1 commit into
mainfrom
fix/llama-upgrade-goose-gateway
Nov 22, 2026
Merged

i386 merged 1 commit into
mainfrom
fix/llama-upgrade-goose-gateway

Conversation

@i386

@i386 i386 commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Original problem

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.

Tracks #12. Failed candidate job.

Diagnostics

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:

Environment Result
Current Skippy subprocess filter Exit 1; exact missing JIANYANG_GATEWAY_TOKEN error
JY-provided environment Exit 0; model replied SKIPPY_GOOSE_PROBE_OK
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.

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 --check

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.

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

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.

Changes: Repair model access

Layer / File(s) Summary
Repair environment handoff
scripts/lib/upgrade_repair.py, scripts/tests/upgrade_contracts.py, .agents/skills/manage-ci/SKILL.md, ci/README.md
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.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related issues

  • 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: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed 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 Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed 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.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • 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.

@i386
i386 merged commit b4309c9 into main Nov 22, 2026
41 checks passed
@i386
i386 deleted the fix/llama-upgrade-goose-gateway branch November 22, 2026 23:31
@i386 i386 mentioned this pull request Nov 23, 2026
2 tasks done
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.

1 participant