Skip to content

fix(config): track wake mode in the config-cache fingerprint - #1293

Closed
ianalitis wants to merge 1827 commits into
1jehuang:masterfrom
ianalitis:jcode/fix-wake-mode-fingerprint
Closed

ianalitis wants to merge 1827 commits into
1jehuang:masterfrom
ianalitis:jcode/fix-wake-mode-fingerprint

Conversation

@ianalitis

@ianalitis ianalitis commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1292

Summary

Add JCODE_WAKE_MODE to CONFIG_ENV_KEYS so changes to this override participate in config-cache invalidation, like the other variables read by Config::apply_env_overrides.

This is a one-line, one-file change based on 5cb7b3dad6029a6f868e36fd4c13cbd07d1fca50. It changes no parser, default, API, dependency, test assertion, workflow, or quality baseline. Initial loading with the override set already works. The omission affects detecting subsequent changes within the process, not changes to another shell's environment.

Regression and verification

Validated in an isolated worktree on macOS arm64 with offline, locked Cargo and temporary configuration directories. Candidate: 510f7c3ffdab972d8b92e8a0b3c36a0081d03849. Baseline/candidate comparison used 0735c75317e644ecb440e0c3dddb7a6b3cd0d8bf. Upstream advanced only docs/images/star-history.svg during validation, so the unpublished branch was rebased. All source, test, dependency, and gate files remain byte-identical to the tested candidate, and the 78 config tests were rerun on the final rebased commit.

Check Observed result
Existing config_env_fingerprint_tracks_every_apply_env_override_var Untouched base: 0 passed, 1 failed, missing ["JCODE_WAKE_MODE"]. Exact unchanged test with the patch: 1 passed, 0 failed.
Entire existing config::tests:: module 78 passed, 0 failed, 0 ignored on Rust 1.94.1 and the repository selfdev wrapper's installed nightly 1.100.0. Rechecked on the final commit. Includes wake-mode parsing, runtime-only variable exclusion, and file/save cache invalidation.
SDK parity 3 passed, 0 failed. Other integration targets were filtered, not additional passes.
Production cargo check --offline --locked Exit 0, with 9 existing-source warnings. The separate warning budget fails, as noted below.
Locked metadata, module resolution, dependency boundaries, wildcard re-export gate, patch whitespace Passed.

Reproduce the focused checks:

scripts/dev_cargo.sh test --offline --locked --profile selfdev \
  -p jcode-base --lib \
  config::tests::config_env_fingerprint_tracks_every_apply_env_override_var \
  -- --exact --test-threads=1
scripts/dev_cargo.sh test --offline --locked \
  -p jcode-base --lib config::tests:: -- --test-threads=1
scripts/dev_cargo.sh test --offline --locked -p jcode-sdk parity -- --nocapture

The existing completeness regression directly covers the omission, so no duplicate test or weakened assertion is added. Production cache behavior was traced in source. A live-daemon wake transition was not exercised.

Review readiness and CI limits

This is not a full-CI pass or a merge-ready claim. Broader validation was run, and blockers were retained rather than patched into this contribution:

  • cargo fmt --all -- --check and the code-size, test-size, panic, and swallowed-error gates fail on both untouched base and candidate. Each gate's output is byte-identical before and after this patch.
  • cargo check --offline --locked --all-targets --all-features fails at five unchanged ModelRoute initializers missing usage in src/cli/commands_tests.rs. The same errors and locations were reproduced on the untouched base.
  • All-target/all-feature Clippy with -D warnings fails on needless_range_loop in crates/jcode-core/src/stdin_detect.rs:333 and needless_return in crates/jcode-terminal-launch/src/lib.rs:269. The same diagnostics were reproduced on the untouched base.
  • The official warning budget fails at 9/0 on the candidate. No warning or lint was suppressed and no budget was raised.
  • Upstream CI's duplicate top-level env mapping remains unchanged. The existing repair is in fix: safe fixes from September 7 issue triage #1193. Linux/Windows execution and full CI acceptance are not claimed. cargo-machete was not installed or run locally.

GitHub's Require Linked Issue run currently reports action_required, with zero jobs executed. No remote test or quality check has been verified green.

Ready for maintainer review: the scoped change is complete, and the full 78-test config module passed again on the exact submitted commit on September 18. This is not a merge-ready or full-CI claim. The upstream baseline failures remain disclosed above; no unrelated fixes are bundled.

Prepared with AI assistance. The submitted diff, production call path, red/green regression, surrounding tests, and baseline-versus-candidate failures were reviewed against recorded evidence.

Workflow assessment: .github/workflows/ci.yml currently has duplicate top-level env keys, already addressed by the open #1193. The issue-link workflow includes ready_for_review; the main CI workflow does not explicitly include that activity type. Existing issue-link runs report action_required with zero jobs. Maintainer workflow approval and repair of the existing CI definition are still needed for usable remote validation. No repository settings or workflow code were changed by this PR.

1jehuang and others added 30 commits August 25, 2026 22:44
@greptile-apps

greptile-apps Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

Safe to merge; no blocking issues were found.

What we checked:

  • Initialized the cached wake-mode configuration with JCODE_WAKE_MODE unset and confirmed the default internal wake mode. T-Rex
  • Updated JCODE_WAKE_MODE to external, reloaded the cached configuration, and confirmed the wake mode is now external. T-Rex
  • Ran a fully qualified unit test to validate the wake-mode behavior and observed the reload generation move from 2 to 3. T-Rex
  • Verified the source restoration check to ensure the cache state matches the external wake mode after reload. T-Rex

Summary

Adds JCODE_WAKE_MODE to the configuration-cache environment fingerprint so changing the override reloads the cached configuration. The focused cache-reload check passed: changing the value from unset to external updated the effective wake mode and advanced the reload generation.

Reviews (1) · Last reviewed commit: "fix(config): track wake mode in cache fi..."

@1jehuang 1jehuang added area: config Configuration, defaults, and environment overrides. size: S Focused change within one component; limited behavior change and few interactions. type: bug Fixes incorrect or broken behavior. and removed area: config Configuration, defaults, and environment overrides. size: S Focused change within one component; limited behavior change and few interactions. type: bug Fixes incorrect or broken behavior. labels Sep 19, 2026
@github-actions github-actions Bot added area: config Configuration, defaults, and environment overrides. size: S Focused change within one component; limited behavior change and few interactions. type: bug Fixes incorrect or broken behavior. labels Sep 19, 2026
@ianalitis

Copy link
Copy Markdown
Contributor Author

Closing as already fixed upstream: e7a22f6 added JCODE_WAKE_MODE to the config-cache fingerprint and is an ancestor of upstream 2a4edaa. This old branch also carries unrelated integration ancestry, so it should not be merged. The remaining JCODE_MEMORY_JEV_PROVIDER fingerprint defect is tracked separately in #1358 and PR #1360.

@ianalitis ianalitis closed this Sep 21, 2026
@ianalitis
ianalitis deleted the jcode/fix-wake-mode-fingerprint branch September 22, 2026 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: config Configuration, defaults, and environment overrides. size: S Focused change within one component; limited behavior change and few interactions. type: bug Fixes incorrect or broken behavior.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(config): JCODE_WAKE_MODE is missing from the config-cache fingerprint

3 participants