Skip to content

jCodex Improvements: Phases 1 & 2#1

Draft
crishacks wants to merge 5 commits into
mainfrom
jcodex-improvements-phase-1-2-4822270293911395302
Draft

jCodex Improvements: Phases 1 & 2#1
crishacks wants to merge 5 commits into
mainfrom
jcodex-improvements-phase-1-2-4822270293911395302

Conversation

@crishacks
Copy link
Copy Markdown
Owner

Implemented Phase 1 (Code Quality) and Phase 2 (Critical Bug Fixes) of the jCodex improvements plan. Key changes include fixing a type coercion bug in ambient tools, updating Minimax endpoints and thinking block handling, improving Ollama model switching, and adding safety checks to the session compaction logic. Also refactored setup hints and resolved several compilation issues.


PR created automatically by Jules for task 4822270293911395302 started by @crishacks

This commit implements Phase 1 and 2 of the jCodex improvements plan:

1.  **Code Quality (Phase 1):**
    - Refactored `src/setup_hints.rs` by inlining platform-specific helper
      functions (`is_ghostty_installed`, `mac_hotkey_support_dir`, etc.) to
      simplify the module structure.
    - Fixed missing semicolons in `crates/jcodex-storage/src/lib.rs`.
    - Renamed `src/provider/jcode.rs` to `src/provider/jcodex.rs` and
      updated the module declaration in `src/provider/mod.rs`.
    - Removed unstable `let_chains` syntax from `src/setup_hints.rs` to
      ensure compatibility with stable Rust.

2.  **Critical Bug Fixes (Phase 2):**
    - **Ambient Tools:** Implemented custom deserializers in
      `src/tool/ambient.rs` to handle `u32` fields being returned as strings
      by LLMs (e.g., in `/end_ambient_cycle`).
    - **Minimax:** Updated the API endpoint to `https://api.minimaxi.chat/v1`
      and added logic to strip thinking blocks when explicitly disabled.
    - **Ollama:** Fixed model switching by triggering a background model
      list refresh (`prefetch_models`) when switching to an Ollama profile.
    - **Compaction:** Added safety checks in `src/compaction.rs` to prevent
      session destruction by validating the compaction cutoff and ensuring
      non-empty summaries are produced before application.

Verified fixes with targeted unit tests (e.g., `cargo test tool::ambient`,
`cargo test compaction`).

Co-authored-by: crishacks <234900867+crishacks@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

google-labs-jules Bot and others added 4 commits May 16, 2026 11:15
This commit implements Phase 1 and 2 of the jCodex improvements plan:

1.  **Code Quality (Phase 1):**
    - Refactored `src/setup_hints.rs` by inlining platform-specific helper
      functions to simplify the module structure.
    - Fixed missing semicolons in `crates/jcodex-storage/src/lib.rs`.
    - Renamed `src/provider/jcode.rs` to `src/provider/jcodex.rs` and
      updated the module declaration in `src/provider/mod.rs`.
    - Removed unstable `let_chains` syntax and fixed formatting.

2.  **Critical Bug Fixes (Phase 2):**
    - **Ambient Tools:** Implemented custom deserializers in
      `src/tool/ambient.rs` to handle `u32` fields returned as strings.
    - **Minimax:** Updated API endpoint and added logic to strip thinking blocks.
    - **Ollama:** Fixed model switching with background prefetch.
    - **Compaction:** Added safety checks to prevent session loss.

Verified fixes with `cargo check`, `cargo fmt`, and targeted unit tests.

Co-authored-by: crishacks <234900867+crishacks@users.noreply.github.com>
This commit implements Phase 1 and 2 of the jCodex improvements plan:

1.  **Code Quality (Phase 1):**
    - Refactored `src/setup_hints.rs` by inlining platform-specific helper
      functions to simplify the module structure.
    - Fixed missing semicolons in `crates/jcodex-storage/src/lib.rs`.
    - Renamed `src/provider/jcode.rs` to `src/provider/jcodex.rs` and
      updated the module declaration in `src/provider/mod.rs`.
    - Removed unstable `let_chains` syntax from `src/setup_hints.rs` and
      `src/prompt.rs` to ensure compatibility with stable Rust.
    - Applied project-wide formatting via `cargo fmt`.

2.  **Critical Bug Fixes (Phase 2):**
    - **Ambient Tools:** Implemented custom deserializers in
      `src/tool/ambient.rs` to handle `u32` fields returned as strings.
    - **Minimax:** Updated API endpoint to `https://api.minimaxi.chat/v1`
      and added logic to strip thinking blocks when explicitly disabled.
    - **Ollama:** Fixed model switching with background prefetch.
    - **Compaction:** Added safety checks to prevent session loss.

Verified fixes with `cargo check`, `cargo fmt`, and targeted unit tests.

Co-authored-by: crishacks <234900867+crishacks@users.noreply.github.com>
- Ambient: Handle LLM string-to-u32 coercion for tool inputs.
- Minimax: Update API endpoint and respect thinking-block settings via reasoning content stripping.
- Ollama: Refresh model catalog on profile switch.
- Setup: Inline and clean up platform-specific hotkey/terminal logic.
- Compaction: Add boundary checks and summary validation to prevent session corruption.
- Rebranding: Rename jcode.rs to jcodex.rs and fix storage crate compilation.
- Compatibility: Replace unstable let_chains with stable Rust syntax.
- CI: Remove DEPLOY_KEY dependencies from core workflows to fix public CI runs.

Co-authored-by: crishacks <234900867+crishacks@users.noreply.github.com>
- Phase 1: Provider rebranding to jcodex, dead code cleanup, and lint hardening.
- Phase 2: Critical bug fixes for Ambient tools (type coercion), Minimax (endpoint & thinking blocks), Ollama (model prefetching), and Compaction (session hardening).
- Phase 3: Implemented custom session names (--name flag), full XDG Base Directory support, global environment rebranding (JCODE_ to JCODEX_), and Automatic Model Routing for complex tasks.
- Improved code quality and documentation across core crates.

Co-authored-by: crishacks <234900867+crishacks@users.noreply.github.com>
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