mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-20 15:25:50 +00:00
Compare commits
12 Commits
v2.6.13
...
feature/do
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0bc132688d | ||
|
|
551a62a2c2 | ||
|
|
2a1f5697cc | ||
|
|
6942f5393f | ||
|
|
7b209ed0cc | ||
|
|
f9a3654167 | ||
|
|
d866b076ba | ||
|
|
3c960323d7 | ||
|
|
2044858b9f | ||
|
|
da10c45e76 | ||
|
|
21c17b4c6e | ||
|
|
6e52043555 |
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "claude-code-best",
|
"name": "claude-code-best",
|
||||||
"version": "2.6.13",
|
"version": "2.6.11",
|
||||||
"description": "Reverse-engineered Anthropic Claude Code CLI — interactive AI coding assistant in the terminal",
|
"description": "Reverse-engineered Anthropic Claude Code CLI — interactive AI coding assistant in the terminal",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"author": "claude-code-best <claude-code-best@proton.me>",
|
"author": "claude-code-best <claude-code-best@proton.me>",
|
||||||
|
|||||||
@@ -1036,16 +1036,6 @@ export function stripExcessMediaItems(
|
|||||||
}) as (UserMessage | AssistantMessage)[]
|
}) as (UserMessage | AssistantMessage)[]
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Module-level cache of deferred-tool lines that have already been announced
|
|
||||||
* via <available-deferred-tools>. Because the injection is ephemeral (appended
|
|
||||||
* to a local `messagesForAPI` that is never persisted back into the caller's
|
|
||||||
* message history), we cannot scan history to detect prior injections — the
|
|
||||||
* injected message is gone after each API call. Instead we keep this Set so we
|
|
||||||
* only re-inject when new deferred tools appear (e.g. MCP server connects).
|
|
||||||
*/
|
|
||||||
const lastAnnouncedDeferredTools = new Set<string>()
|
|
||||||
|
|
||||||
async function* queryModel(
|
async function* queryModel(
|
||||||
messages: Message[],
|
messages: Message[],
|
||||||
systemPrompt: SystemPrompt,
|
systemPrompt: SystemPrompt,
|
||||||
@@ -1395,25 +1385,14 @@ async function* queryModel(
|
|||||||
// via persisted deferred_tools_delta attachments instead of this
|
// via persisted deferred_tools_delta attachments instead of this
|
||||||
// ephemeral prepend (which busts cache whenever the pool changes).
|
// ephemeral prepend (which busts cache whenever the pool changes).
|
||||||
if (useSearchExtraTools && !isDeferredToolsDeltaEnabled()) {
|
if (useSearchExtraTools && !isDeferredToolsDeltaEnabled()) {
|
||||||
// Diff current deferred tools against what's already been announced in
|
|
||||||
// prior <available-deferred-tools> injections. Only re-inject when new
|
|
||||||
// tools appear (e.g. MCP server connects mid-session).
|
|
||||||
const deferredToolList = tools
|
const deferredToolList = tools
|
||||||
.filter(t => deferredToolNames.has(t.name))
|
.filter(t => deferredToolNames.has(t.name))
|
||||||
.map(formatDeferredToolLine)
|
.map(formatDeferredToolLine)
|
||||||
.sort()
|
.sort()
|
||||||
.join('\n')
|
.join('\n')
|
||||||
|
|
||||||
if (deferredToolList) {
|
if (deferredToolList) {
|
||||||
const currentTools = new Set(deferredToolList.split('\n'))
|
// Append to the end of the messages array (not prepend) so it
|
||||||
const hasNewTools = [...currentTools].some(
|
// never抢占 <project-instructions> (CLAUDE.md) at the front.
|
||||||
t => !lastAnnouncedDeferredTools.has(t),
|
|
||||||
)
|
|
||||||
|
|
||||||
if (hasNewTools) {
|
|
||||||
lastAnnouncedDeferredTools.clear()
|
|
||||||
for (const t of currentTools) lastAnnouncedDeferredTools.add(t)
|
|
||||||
|
|
||||||
messagesForAPI = [
|
messagesForAPI = [
|
||||||
...messagesForAPI,
|
...messagesForAPI,
|
||||||
createUserMessage({
|
createUserMessage({
|
||||||
@@ -1423,7 +1402,6 @@ async function* queryModel(
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Chrome tool-search instructions: when the delta attachment is enabled,
|
// Chrome tool-search instructions: when the delta attachment is enabled,
|
||||||
// these are carried as a client-side block in mcp_instructions_delta
|
// these are carried as a client-side block in mcp_instructions_delta
|
||||||
|
|||||||
Reference in New Issue
Block a user