Remove upstream-project attribution from docs and code comments
Strips references to the upstream npm-package agent harness from README design notes, developer.md, the compaction package, the runtime context/streaming comments, and the tools/mcp adapter doc-comments. The technical patterns being described stand on their own; the attribution chain isn't needed. Remaining mentions of the word in the providers/anthropic package are literal Anthropic model identifiers (the 'claude-…' API model strings) — those are functional product names, not attribution.
This commit is contained in:
1 parent
fa61dbdf77
commit
7e9801bf9c
8 files changed
+17
-26
No files matched your search
@@ -221,10 +221,10 @@ Deliberately not in scope (numbers from the same conceptual list):
|
||||
valid.
|
||||
- **Compaction at a clean boundary.** `compaction.Split` walks
|
||||
backward counting user messages and cuts at one — never inside a
|
||||
tool-call/tool-result pair. The prompt itself (`compaction/prompt.go`)
|
||||
is adapted from Claude Code's `BASE_COMPACT_PROMPT` and emits a
|
||||
9-section structured summary inside an `<analysis>` + `<summary>`
|
||||
envelope; the `<analysis>` block is stripped before re-injection.
|
||||
tool-call/tool-result pair. The prompt (`compaction/prompt.go`)
|
||||
emits a 9-section structured summary inside an `<analysis>` +
|
||||
`<summary>` envelope; the `<analysis>` block is stripped before
|
||||
re-injection.
|
||||
- **Plug-points are nil-friendly.** `MemoryProvider`,
|
||||
`KnowledgeGraph`, `SkillProvider`, `SubagentResolver`,
|
||||
`PermissionChecker`, `LifecycleHooks`, and `session.Store` are all
|
||||
@@ -284,8 +284,9 @@ these, you'll need to bring them yourself or layer them on top:
|
||||
- **Auth / billing / multi-tenant infrastructure.** Per-agent
|
||||
policy lives in `PermissionChecker`; everything else is your
|
||||
problem.
|
||||
- **Shell-command hooks (Claude Code style).** Hooks are typed Go
|
||||
callbacks on `LifecycleHooks`, not subprocess invocations.
|
||||
- **Shell-command hooks.** Hooks are typed Go callbacks on
|
||||
`LifecycleHooks`, not subprocess invocations driven by a config
|
||||
file.
|
||||
|
||||
## Testing
|
||||
|
||||
|
||||
@@ -19,9 +19,6 @@ import (
|
||||
// The breaker resets on any genuine summarizer success (stage 1 or 2
|
||||
// returning real content). It exists to prevent a session whose context
|
||||
// is irrecoverably over the limit from hammering the API on every turn.
|
||||
//
|
||||
// Pattern from Claude Code MAX_CONSECUTIVE_AUTOCOMPACT_FAILURES
|
||||
// (src/services/compact/autoCompact.ts:67-70).
|
||||
const MaxConsecutiveFailures = 3
|
||||
|
||||
// Reason identifies why compaction was triggered.
|
||||
|
||||
@@ -57,9 +57,6 @@ func transcriptDelimiterSuffix() string {
|
||||
// - The <analysis> block is a drafting scratchpad (stripped before
|
||||
// injection by FormatCompactSummary). It improves summary quality on
|
||||
// small models without polluting the resulting context.
|
||||
//
|
||||
// Pattern adapted from Claude Code's BASE_COMPACT_PROMPT
|
||||
// (claude-code-source/src/services/compact/prompt.ts:61-143).
|
||||
const summarizationPromptHeader = `You are summarizing an AI assistant's conversation so it can continue past the context window.
|
||||
|
||||
CRITICAL: Respond with TEXT ONLY. Do NOT call any tools. The output must be an <analysis> block followed by a <summary> block — nothing else.
|
||||
@@ -247,9 +244,6 @@ var blankLineCollapseRE = regexp.MustCompile(`\n{3,}`)
|
||||
// returned as-is so we never silently drop content. Multiple <summary>
|
||||
// blocks (rare, but possible) are each unwrapped consistently so no literal
|
||||
// tags leak into the injected context.
|
||||
//
|
||||
// Pattern adapted from Claude Code's formatCompactSummary
|
||||
// (claude-code-source/src/services/compact/prompt.ts:311-335).
|
||||
func FormatCompactSummary(raw string) string {
|
||||
out := analysisBlockRE.ReplaceAllString(raw, "")
|
||||
|
||||
|
||||
+2
-2
@@ -362,8 +362,8 @@ reg.Register(&EnvTool{})
|
||||
|
||||
### Returning images
|
||||
|
||||
Vision-capable models (Claude, GPT-4o, Gemini) can see images returned
|
||||
from a tool. Set `ToolResult.Images`:
|
||||
Vision-capable models can see images returned from a tool. Set
|
||||
`ToolResult.Images`:
|
||||
|
||||
```go
|
||||
return tool.ToolResult{
|
||||
|
||||
+3
-3
@@ -501,8 +501,8 @@ func FormatDateLine(now time.Time) string {
|
||||
|
||||
// PostCompactRestoreFiles caps how many recently-touched files
|
||||
// buildPostCompactRestore re-injects after a successful compaction.
|
||||
// 5 mirrors Claude Code's harness behaviour (harness.md §3) and keeps
|
||||
// the restore message bounded.
|
||||
// 5 keeps the restore message bounded while covering the typical
|
||||
// "the last few files I was working on" recall horizon.
|
||||
const PostCompactRestoreFiles = 5
|
||||
|
||||
// PostCompactRestoreBytesPerFile bounds the per-file byte budget for
|
||||
@@ -542,7 +542,7 @@ func extractPathFromInput(raw []byte) string {
|
||||
//
|
||||
// Format is wrapped in <system-reminder>...<file path="...">...</file>
|
||||
// tags so the model recognises it as out-of-band context, not a fresh
|
||||
// user request. Mirrors how Claude Code re-injects POST_COMPACT files.
|
||||
// user request.
|
||||
func buildPostCompactRestore(files []string, maxFiles, maxBytesPerFile int) llm.Message {
|
||||
if len(files) == 0 || maxFiles <= 0 || maxBytesPerFile <= 0 {
|
||||
return llm.Message{}
|
||||
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
// 3. Otherwise off.
|
||||
//
|
||||
// Strict "1" for the env fallback (rather than truthy parsing) keeps the
|
||||
// env contract simple and matches Claude Code's binary-feature-gate posture.
|
||||
// env contract simple and unambiguous.
|
||||
// Note: an explicit `false` in JSON5 behaves the same as the field being
|
||||
// absent — to disable, leave both unset.
|
||||
func (r *Runtime) streamingToolsEnabled() bool {
|
||||
|
||||
@@ -20,9 +20,8 @@ type mcpToolAdapter struct {
|
||||
}
|
||||
|
||||
// Name returns "mcp__<server>__<tool>". The double-underscore
|
||||
// namespacing matches Claude Code so the LLM treats these tools the
|
||||
// same way it would in CC and so they can't collide with built-in
|
||||
// harness tools.
|
||||
// namespacing prevents collisions with built-in harness tools and
|
||||
// is the convention most agent harnesses use for MCP-sourced tools.
|
||||
func (a *mcpToolAdapter) Name() string {
|
||||
return "mcp__" + a.serverName + "__" + a.sdkTool.Name
|
||||
}
|
||||
|
||||
+2
-2
@@ -35,8 +35,8 @@ import (
|
||||
// (Streamable HTTP via the SDK's StreamableClientTransport).
|
||||
type ServerConfig struct {
|
||||
// Name namespaces the server's tools. Adapter tool names become
|
||||
// "mcp__<Name>__<tool>", matching Claude Code's convention so the
|
||||
// LLM treats them the same way.
|
||||
// "mcp__<Name>__<tool>" — the conventional double-underscore
|
||||
// scheme that prevents collisions with built-in tools.
|
||||
Name string
|
||||
|
||||
// Command + Args + Env wire the stdio transport. Env is merged into
|
||||
|
||||
Reference in new issue
Block a user