Skip to content

feat: make pctx/Code Mode an optional dependency via 'code-mode' feature#7567

Merged
jh-block merged 1 commit intomainfrom
jhugo/optional-code-mode
Feb 27, 2026
Merged

feat: make pctx/Code Mode an optional dependency via 'code-mode' feature#7567
jh-block merged 1 commit intomainfrom
jhugo/optional-code-mode

Conversation

@jh-block
Copy link
Collaborator

@jh-block jh-block commented Feb 27, 2026

Summary

Gate pctx_code_mode (and its V8 dependency) behind a Cargo feature flag so users can build from source without building V8 in environments where binary prebuilts are disallowed.

Changes

  • crates/goose/Cargo.toml: Added code-mode feature (default-enabled), made pctx_code_mode optional
  • crates/goose/src/agents/platform_extensions/mod.rs: Gated code_execution module and its PLATFORM_EXTENSIONS entry behind #[cfg(feature = "code-mode")]; stub module when off
  • crates/goose/src/agents/reply_parts.rs: Gated code-execution-specific logic; defaults to disabled when feature is off
  • crates/goose-cli/Cargo.toml, crates/goose-server/Cargo.toml, crates/goose-acp/Cargo.toml: Forward the code-mode feature

Usage

Build command Result
cargo build Unchanged — Code Mode included (feature on by default)
cargo build --no-default-features Skips pctx/V8 entirely, Code Mode absent at runtime

When built without the feature, Code Mode does not appear in the Extensions list in the desktop UI since it is never registered in PLATFORM_EXTENSIONS.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 96a66956cd

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@jh-block jh-block force-pushed the jhugo/optional-code-mode branch from 96a6695 to c36e1f7 Compare February 27, 2026 10:51
Gate pctx_code_mode behind a Cargo feature flag so users can build from
source without building V8 in environments where binary prebuilts are
disallowed.

The 'code-mode' feature is enabled by default so existing builds are
unaffected. Building with --no-default-features omits pctx/V8 entirely
and removes Code Mode from the platform extensions list.
@jh-block jh-block force-pushed the jhugo/optional-code-mode branch from c36e1f7 to 0d29a05 Compare February 27, 2026 14:02
@jh-block jh-block added this pull request to the merge queue Feb 27, 2026
Merged via the queue into main with commit 69ad519 Feb 27, 2026
23 of 28 checks passed
@jh-block jh-block deleted the jhugo/optional-code-mode branch February 27, 2026 16:11
tlongwell-block added a commit that referenced this pull request Feb 27, 2026
…m-extension-pr

* origin/main:
  Update CODEOWNERS for team restructuring (#7574)
  Add snapshot test with platform extensions (#7573)
  Handle Bedrock 'prompt is too long' error (#7550)
  feat: make pctx/Code Mode an optional dependency via 'code-mode' feature (#7567)
  chore(release): release version 1.26.0 (minor) (#7512)
  feat: allow goose askai bot to search goose codebase (#7508)
  Revert "Reapply "fix: prevent crashes in long-running Electron sessions""
  Reapply "fix: prevent crashes in long-running Electron sessions"
  Revert "fix: prevent crashes in long-running Electron sessions"
  fix: replace unwrap() with graceful error in scheduler execute_job (#7436)
  fix: Dictation API error message shows incorrect limit (#7423)
  fix(acp): Use ACP schema types for session/list (#7409)
  fix(desktop): make bundle and updater asset naming configurable (#7337)
  fix(openai): preserve order in Responses API history (#7500)
  Use the correct Goose emoji 🪿 instead of Swan in README.md (#7485)
  fix: prevent crashes in long-running Electron sessions
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.

2 participants