Skip to content

Rebrand/shadow code - #13208

Closed
deepak-s-2000 wants to merge 5 commits into
continuedev:mainfrom
deepak-s-2000:rebrand/shadow-code
Closed

Rebrand/shadow code#13208
deepak-s-2000 wants to merge 5 commits into
continuedev:mainfrom
deepak-s-2000:rebrand/shadow-code

Conversation

@deepak-s-2000

Copy link
Copy Markdown

Description

[ What changed? Feel free to be brief. ]

AI Code Review

  • Team members only: AI review runs automatically when PR is opened or marked ready for review
  • Team members can also trigger a review by commenting @continue-review

Checklist

  • [] I've read the contributing guide
  • [] The relevant docs, if any, have been updated or created
  • [] The relevant tests, if any, have been updated or created

Screen recording or screenshot

[ When applicable, please include a short screen recording or screenshot - this makes it much easier for us as contributors to review and understand your changes. See this PR as a good example. ]

Tests

[ What tests were added or updated to ensure the changes work as expected? ]

deepak-s-2000 and others added 5 commits June 25, 2026 18:30
Ports shadow-chat's token optimization natively into the TypeScript core
so all LLM providers (OpenAI, Gemini, Anthropic, Ollama, etc.) get up to
97% input token reduction without any BYOK config changes.

New files:
- core/util/shadowChatSessionId.ts: stable session ID via sha256(first message)
- core/data/shadowChatDb.ts: SQLite storage with FTS5 for history/search/stats
- core/tools/implementations/shadowChatHistory.ts: 7 internal shadow_* tools
- core/llm/tokenOptimizedChat.ts: agentic loop that executes tools server-side

Shadow tools available to the LLM on demand:
  shadow_get_chat_history, shadow_search_messages, shadow_semantic_search,
  shadow_get_conversation_stats, shadow_get_tool_result,
  shadow_search_all_sessions, shadow_semantic_search_all_sessions

Modified files:
- core/index.d.ts: add ultraTokenSaving to ContinueUIConfig
- core/config/sharedConfig.ts: wire ultraTokenSaving through shared config
- core/llm/streamChat.ts: intercept calls when ultra mode enabled; block
  mid-conversation mode changes with an in-chat error message
- gui/src/pages/config/sections/UserSettingsSection.tsx: add Ultra Token
  Saving toggle in Chat settings (below Show Session Tabs)
… to built-ins

Ultra Token Saving's session ID was hashed from messages[0], which is the
system prompt (constructMessages.ts always unshifts one) rather than the
first user message. Since the system prompt is near-identical across
unrelated conversations, this collided every chat sharing a mode into one
session, leaking chat history between them, and meant the mid-conversation
toggle guard never actually recorded a session to compare against. Session
ID now prefers the GUI's real per-conversation UUID (threaded through
llm/streamChat and tools/call), falling back to hashing the first user
message only when a client doesn't supply one.

The 7 shadow_* tools are now registered as real built-in tools
(core/tools/builtIn.ts, definitions/shadowChatHistory.ts, callTool.ts) in
the BUILT_IN_GROUP_NAME group, so they're visible in Settings > Tools and
usable by normal (non-ultra) chat, not just force-injected in ultra mode.
Ultra mode still executes them inside its own internal loop rather than
round-tripping through the client -- that's what keeps "only the current
message is sent" true -- but now yields the resolved call/result as chunks
so the UI renders the same tool-call card instead of silently swallowing
them, and streamUpdate() marks the call done+output immediately instead of
leaving it stuck on "generating" (nothing else would ever resolve it).

Also:
- Persist tool call input/output immediately at execution time for every
  built-in and MCP tool (not just shadow ones), via a hook in callTool()
  plus one in the ultra-mode internal loop. Replaces the old capture in
  saveMessages(), which only saw client-echoed results a turn late and
  never had the arguments.
- Fix shadow_semantic_search throwing on any query containing punctuation
  (FTS5 MATCH parses it as query syntax) by quoting queries as a literal
  phrase.
- Show tool arguments in the UI for tools without a bespoke display
  (previously only output was ever visible).
- core/sqlite3 and core/sharp bumped to versions with prebuilt Windows
  ARM64 binaries (dev-environment fix, unrelated to the above).
Adds a "claudecode" LLM provider that spawns `claude -p` per turn instead
of calling a metered API, so chat can run through a Claude subscription
instead of an API key. Continue's own harness stays authoritative:

- core/mcp/shadowCodeToolsServer.ts hosts Continue's own tools as an
  in-process MCP server (stateful Streamable HTTP - stateless mode is
  broken on Windows in the installed SDK) instead of letting Claude Code
  use its own Read/Write/Edit/Bash.
- core/llm/llms/ClaudeCodeCli.ts is the provider: disables Claude Code's
  built-in tools, overrides its system prompt, and yields paired
  toolCall/result chunks so already-resolved MCP tool calls render as
  history rather than pending work.
- A new claudeCodeCli/authorizeToolCall Core->GUI request
  (core/protocol/webview.ts, gui/src/hooks/ClaudeCodeCliApprovalGate.tsx)
  routes every tool call through the same policy/approval flow normal
  tool calls use.
- Cross-turn memory reuses the existing Ultra Token Saving path
  (ShadowChatDb + shadow_* tools) instead of CLI-native session
  continuity, forced on for this provider in core/llm/streamChat.ts and
  core/llm/tokenOptimizedChat.ts since it isn't optional here.
- core/tools/implementations/serverSideEdit.ts makes
  single_find_and_replace/multi_edit work when called via MCP (previously
  client-only), reusing the same deterministic preprocessArgs computation
  the GUI's client tools already depend on.

Also adds CLAUDE.md documenting the product intent and architecture for
future sessions.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Rename the product for independent publishing as a VS Code extension
(+ JetBrains plugin + CLI).

Naming scheme:
- display name "Shadow Code"; package/slug "shadow-code"
- code namespace for string IDs "shadowCode." (commands, settings, context
  keys, webview view IDs)
- global data dir ~/.shadow-code; workspace dir .shadow-code/; ignore/rc
  files .shadow-codeignore / .shadow-coderc.json / .shadow-coderules
- env var prefix SHADOW_CODE_; IntelliJ plugin id com.shadowcode.plugin

Scope: extensions/vscode + gui + core + binary + extensions/cli +
extensions/intellij + docs + .github. VSIX builds clean
(extensions/vscode/build/shadow-code-*.vsix); all TS projects type-check;
core/gui unit tests green.

Icons: user-supplied spiral icon for media/icon.png; generated spiral SVG
for the activity bar (media/sidebar-icon.svg), the GUI logo
(ShadowCodeLogo.tsx), and the JetBrains plugin/tool-window icons.

Deliberately unchanged (functional / legal, not user-facing branding):
- @continuedev/* npm scope; continue-proxy provider id; X-Continue-Provider
  header; api./hub.continue.dev backend endpoints
- upstream copyright line in LICENSE.txt (Apache-2.0 requires it; a Shadow
  Code line was added)
- internal TS symbol names and webview-protocol message names
  (SerializedContinueConfig, focusContinueInput, ...)
- IntelliJ Kotlin package com.github.continuedev.continueintellijextension
- code comments linking upstream issues/PRs

Still open: marketplace publisher id (placeholder "shadow-code"); CLI binary
name (kept as "cn"). Includes pre-existing in-progress work on the Claude
Code CLI provider that was already in the working tree.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016Np5Eu8A665zkGmLuPouUn
@deepak-s-2000
deepak-s-2000 requested a review from a team as a code owner August 31, 2026 18:36
@deepak-s-2000
deepak-s-2000 requested review from sestinj and removed request for a team August 31, 2026 18:36
@github-actions

Copy link
Copy Markdown
Contributor


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@github-actions github-actions Bot locked and limited conversation to collaborators Aug 31, 2026
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.

1 participant