Skip to content
This repository was archived by the owner on Sep 30, 2026. It is now read-only.

chore: sync fork with upstream jcode (515 behind) - #20

Closed
yjuyjuy wants to merge 518 commits into
masterfrom
fm/sync-jcode-upstream
Closed

yjuyjuy wants to merge 518 commits into
masterfrom
fm/sync-jcode-upstream

Conversation

@yjuyjuy

@yjuyjuy yjuyjuy commented Aug 13, 2026

Copy link
Copy Markdown
Owner

Summary

Merges the latest upstream jcode (1jehuang/jcode master, at bf4d79bed) into our fork's master as a real merge commit, bringing the fork from 8 ahead / 515 behind up to date while preserving every load-bearing fork patch.

  • Merge commit: 3d5b7d735 (parents: 25b3b5264 our master, bf4d79bed upstream/master)
  • Two follow-up build fixes on top of the merge for new upstream construction sites (see below).

Upstream range brought in spans roughly v0.68.0 -> v0.75.5, including the TypeScript/Rust SDKs, desktop2 workspace work, the schema-dialect provider system, ACP active-skill support, todo semantic-assessment gates, telemetry transcript pipeline, and many provider/auth fixes.

Fork patches preserved

Every fork commit's behavior was verified present and functional in the merged tree:

PR Patch Verified
#1 Agent-callable compact_context tool tool/compact.rs present; CompactContextTool registered in tool/mod.rs; drain_pending_compaction_request() still called in agent/turn_loops.rs; PENDING_COMPACTION_REQUESTS machinery intact
#3 ScheduleWakeup OAuth schema fix jcode-provider-anthropic/src/lib.rs keeps schedule out of the OAuth curated deny-list and forwards the real backend schema under the ScheduleWakeup name; regression test preserved
#4 Stop blocking Opus models for Claude Pro OAuth Opus-blocking removed from auth/claude.rs (no opus references remain); provider/routing.rs keeps opus_route_available_regardless_of_subscription_tier behavior/tests
#7 Pace-aware account balancing + unify 1jehuang#706 usage/pace.rs + pace_tests.rs present; pace_aware_account_balancing config field in jcode-config-types and wired in provider/startup.rs
#8 Auto-switch account on revoked/invalid_grant OAuth provider-core/src/failover.rs retains the invalid_grant/revoked handling (not just 401)
#13 Disable Alt+B/Ctrl+B move-tool-to-background No background_tool() call remains in remote/key_handling.rs; Alt+B/Ctrl+B now do word-cursor movement only; info-widget tip removed
#14 Server-side submission-nonce dedup server/message_nonce_dedup.rs present; submission_nonce field on the wire Request::Message; dedup guard + record path intact in server/client_lifecycle.rs

(#2 was the previous fork sync-merge; its content is fully subsumed by this newer upstream base.)

Non-trivial conflict resolutions

101 conflicted paths were resolved. Most were mechanical (version bumps, size-budget JSON, changelog index, npm/telemetry package.json) and took upstream. The substantive Rust merges:

  • jcode-protocol/src/wire.rs and all protocol-test mirrors: kept BOTH upstream's new active_skill: Option<String> and our submission_nonce: Option<String> on Request::Message. The jcode-app-core protocol-test copies use app-core's own Request type (no active_skill), so those took our nonce-only side.
  • server/client_lifecycle.rs: interleaved our fix(server): dedup re-sent user submissions via a stable submission nonce #14 nonce dedup (duplicate short-circuit + message_nonce_tracker.record) with upstream's active_skill gate (set_remote_active_skill) and terminal-env refactor. Removed a merge-introduced use-after-move duplicate assignment of active_terminal_env.
  • jcode-tui/src/tui/backend.rs + remote/input_dispatch.rs: unified the two divergent send helpers into one send_message_with_images_reminder_skill_and_nonce(...) carrying both active_skill and submission_nonce, updated the single call site.
  • agent/turn_loops.rs, tool/mod.rs: took upstream additions while keeping our compaction plumbing.
  • config_tests.rs, remote_events_reload_05.rs: took upstream's expanded test coverage while preserving our injected submission_nonce fixtures.
  • Cargo.lock: regenerated via cargo update --workspace against the merged manifests rather than hand-merging (0 net dependency changes vs upstream lock).
  • jcode-harness-api-server/Cargo.toml: git had silently duplicated the [target.'cfg(unix)'.dependencies] block on a non-conflicted file; reset to the (identical) upstream version.

Two follow-up commits fix new upstream construction sites that our added struct fields made incomplete:

  • d123c6334: add active_skill to a ProcessingMessage in client_lifecycle_tests.rs.
  • b9952695c: add submission_nonce to a PendingRemoteMessage in the upstream-new issue_496_input_routing.rs test.

Validation

  • cargo build --workspace: PASS (exit 0).
  • cargo test for jcode-protocol, jcode-config-types, jcode-provider-core, jcode-provider-anthropic: PASS (126+ tests, 0 failures).
  • cargo test -p jcode-base -p jcode-app-core: our merge fixes the build and adds 8 passing tests. 8 tests fail, but these are pre-existing upstream failures: the identical 8 fail on a clean upstream/master checkout in this sandbox (token_cap heuristic tests plus swarm/communicate/bash tests that need network or process-group privileges unavailable here). No new failures introduced.
  • cargo clippy on all touched crates: PASS (0 errors; only pre-existing upstream style warnings in untouched files).
  • jcode-tui: merged code compiles and links; the full --lib suite hangs at pty init in this sandbox (a known-env limitation unrelated to this change).

Test coverage note

This is a merge, not a feature change, so it was not built test-first. Coverage is inherited from both sides; the two follow-up fixes are covered by the existing upstream tests they repair. No new product behavior was added that needs new end-to-end coverage.

1jehuang added 30 commits August 5, 2026 02:08
# Conflicts:
#	src/cli/commands/menubar.rs
#	src/cli/commands_tests.rs
# Conflicts:
#	crates/jcode-app-core/src/server/client_lifecycle.rs
#	crates/jcode-base/src/config/env_overrides.rs
#	crates/jcode-base/src/config_tests.rs
#	crates/jcode-base/src/hooks.rs
#	crates/jcode-config-types/src/lib.rs
#	crates/jcode-terminal-launch/src/lib.rs
# Conflicts:
#	Cargo.lock
#	Cargo.toml
#	changelog/index.json
#	crates/jcode-app-core/src/agent_tests.rs
#	crates/jcode-app-core/src/tool/discover.rs
#	crates/jcode-app-core/src/tool/todo.rs
#	docs/DISCOVERY_RATE_BENCHMARK.md
#	scripts/benchmark_discovery.py
#	scripts/benchmark_discovery_rate.py
#	scripts/test_benchmark_discovery_rate.py
This reverts commit 0827a9d, reversing
changes made to cebff22.
ACP clients (Zed's Agent Panel etc.) previously saw none of jcode's
model switching, reasoning effort, or token usage even though the TUI
supports all three (issue 1jehuang#765).

- session/new and session/load responses now include configOptions:
  a model selector (category: model) built from the daemon's history
  snapshot, plus a reasoning-effort selector (category: thought_level)
  from the shared provider-core effort ladder (swarm sentinels are
  filtered out since they are TUI-only).
- session/set_config_option applies model or effort changes via the
  daemon's set_model / set_reasoning_effort requests and re-broadcasts
  a config_option_update session update on success.
- Token usage events from the daemon now map to usage_update session
  updates using the shared effective-context heuristic and the model's
  context limit.
- Mid-prompt ModelChanged events (provider failover) also refresh the
  advertised config options.

Closes 1jehuang#765
The ACP schema marks configOptions as required on
SetSessionConfigOptionResponse; validating live output against the
official v1 schema caught the empty-object response. Also keeps the
config_option_update broadcast for other attached clients.
1jehuang and others added 26 commits August 12, 2026 12:46
The artifact generator now covers all resting states in onboarding_graph.rs:
welcome-card states render via the onboarding layout, and picker-overlay and
session states (start choice, suggestions, accepted review turn) render the
full app frame via ui::draw. Also update the telemetry golden assertions to
the copy introduced by the transcript-telemetry pipeline.
Two sources of run-to-run drift leaked into the full-frame render: the
Updates box (unseen changelog entries from the generating machine) and the
randomly drawn session mascot name. Pin both. Two consecutive generator
runs now produce byte-identical SVGs for all 12 states.
…tream

# Conflicts:
#	AGENTS.md
#	Cargo.lock
#	Cargo.toml
#	TELEMETRY.md
#	changelog/index.json
#	crates/jcode-app-core/src/agent/response_recovery.rs
#	crates/jcode-app-core/src/agent/turn_execution.rs
#	crates/jcode-app-core/src/agent/turn_loops.rs
#	crates/jcode-app-core/src/agent_tests.rs
#	crates/jcode-app-core/src/protocol_tests/core_events.rs
#	crates/jcode-app-core/src/protocol_tests/misc_events.rs
#	crates/jcode-app-core/src/protocol_tests/randomized.rs
#	crates/jcode-app-core/src/server/client_api.rs
#	crates/jcode-app-core/src/server/client_lifecycle.rs
#	crates/jcode-app-core/src/server/client_lifecycle_tests.rs
#	crates/jcode-app-core/src/tool/communicate_tests.rs
#	crates/jcode-app-core/src/tool/discover.rs
#	crates/jcode-app-core/src/tool/mod.rs
#	crates/jcode-app-core/src/tool/selfdev/build_queue.rs
#	crates/jcode-app-core/src/tool/tests.rs
#	crates/jcode-app-core/src/tool/todo.rs
#	crates/jcode-base/src/config_tests.rs
#	crates/jcode-base/src/hooks.rs
#	crates/jcode-base/src/provider/jcode.rs
#	crates/jcode-base/src/todo.rs
#	crates/jcode-desktop2/Cargo.toml
#	crates/jcode-desktop2/src/app_harness.rs
#	crates/jcode-desktop2/src/app_model_picker.rs
#	crates/jcode-desktop2/src/app_overview.rs
#	crates/jcode-desktop2/src/app_workspace.rs
#	crates/jcode-desktop2/src/cli.rs
#	crates/jcode-desktop2/src/harness.rs
#	crates/jcode-desktop2/src/keymap.rs
#	crates/jcode-desktop2/src/layout.rs
#	crates/jcode-desktop2/src/main.rs
#	crates/jcode-desktop2/src/model_picker.rs
#	crates/jcode-desktop2/src/scene.rs
#	crates/jcode-desktop2/src/scene_workspace.rs
#	crates/jcode-desktop2/src/selfdev_reload.rs
#	crates/jcode-desktop2/src/states.rs
#	crates/jcode-desktop2/src/strip.rs
#	crates/jcode-desktop2/src/tests/actions.rs
#	crates/jcode-desktop2/src/tests/model_picker.rs
#	crates/jcode-desktop2/src/tests/overview_gesture.rs
#	crates/jcode-desktop2/src/tests/overview_visual.rs
#	crates/jcode-desktop2/src/workspace.rs
#	crates/jcode-protocol/src/protocol_tests/core_events.rs
#	crates/jcode-protocol/src/protocol_tests/misc_events.rs
#	crates/jcode-protocol/src/protocol_tests/randomized.rs
#	crates/jcode-protocol/src/wire.rs
#	crates/jcode-provider-core/src/openai_schema.rs
#	crates/jcode-provider-openrouter-runtime/src/ollama_context.rs
#	crates/jcode-provider-openrouter-runtime/src/ollama_context_tests.rs
#	crates/jcode-provider-openrouter-runtime/src/openrouter_provider_impl.rs
#	crates/jcode-provider-openrouter/src/request.rs
#	crates/jcode-sdk/src/diagnostics.rs
#	crates/jcode-sdk/src/launch.rs
#	crates/jcode-task-types/src/lib.rs
#	crates/jcode-telemetry-core/src/lib.rs
#	crates/jcode-telemetry-core/src/lifecycle.rs
#	crates/jcode-telemetry-core/src/tests.rs
#	crates/jcode-terminal-launch/src/lib.rs
#	crates/jcode-tui/src/tui/app/auth.rs
#	crates/jcode-tui/src/tui/app/inline_interactive.rs
#	crates/jcode-tui/src/tui/app/input.rs
#	crates/jcode-tui/src/tui/app/onboarding_graph.rs
#	crates/jcode-tui/src/tui/app/remote/input_dispatch.rs
#	crates/jcode-tui/src/tui/app/tests.rs
#	crates/jcode-tui/src/tui/app/tests/issue_699_ctrl_d_delete.rs
#	crates/jcode-tui/src/tui/app/tests/remote_events_reload_01/part_02.rs
#	crates/jcode-tui/src/tui/app/tests/remote_events_reload_05.rs
#	crates/jcode-tui/src/tui/app/tests/state_model_poke_03.rs
#	crates/jcode-tui/src/tui/app/todos_view.rs
#	crates/jcode-tui/src/tui/app/turn_notify.rs
#	crates/jcode-tui/src/tui/backend.rs
#	crates/jcode-tui/src/tui/info_widget_tests.rs
#	crates/jcode-tui/src/tui/info_widget_todos.rs
#	crates/jcode-tui/src/tui/ui_messages.rs
#	crates/jcode-tui/src/tui/ui_messages/tests.rs
#	crates/jcode-tui/src/tui/ui_onboarding.rs
#	crates/jcode-usage-types/src/lib.rs
#	docs/DISCOVERY_RATE_BENCHMARK.md
#	scripts/benchmark_discovery_rate.py
#	scripts/code_size_budget.json
#	scripts/test_benchmark_discovery.py
#	scripts/test_benchmark_discovery_rate.py
#	scripts/test_size_budget.json
#	sdk/npm/darwin-arm64/package.json
#	sdk/npm/darwin-x64/package.json
#	sdk/npm/linux-arm64/package.json
#	sdk/npm/linux-x64/package.json
#	sdk/npm/win32-arm64/package.json
#	sdk/npm/win32-x64/package.json
#	sdk/typescript/package-lock.json
#	sdk/typescript/package.json
#	sdk/typescript/src/launch.ts
#	sdk/typescript/src/protocol.ts
#	sdk/typescript/test/launch.test.ts
#	src/cli/acp.rs
#	src/cli/args.rs
#	telemetry-worker/package.json
The upstream active_skill field must be set at every ProcessingMessage
construction site. The nonce-dedup regression test added by our fork
(#14) constructed one without it after the merge, breaking the build.
Our fork (#14) added a submission_nonce field to PendingRemoteMessage.
The upstream-new issue_496 input-routing test constructs one without it,
so the field must be set here too after the merge.
@yjuyjuy

yjuyjuy commented Aug 14, 2026

Copy link
Copy Markdown
Owner Author

Superseded by #24 (fresh sync onto current master); closing.

@yjuyjuy yjuyjuy closed this Aug 14, 2026
@yjuyjuy
yjuyjuy deleted the fm/sync-jcode-upstream branch August 14, 2026 14:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants