refactor(session): align namespace imports and inline trivial helpers (#30180)

This commit is contained in:
Aiden Cline
2026-06-01 00:00:40 -05:00
committed by GitHub
parent b258a55a6c
commit f9ba23ab62
12 changed files with 25 additions and 36 deletions
+5 -7
View File
@@ -12,12 +12,6 @@ import { Global } from "@opencode-ai/core/global"
import type { MessageV2 } from "./message-v2"
import type { MessageID } from "./schema"
const files = (disableClaudeCodePrompt: boolean) => [
"AGENTS.md",
...(disableClaudeCodePrompt ? [] : ["CLAUDE.md"]),
"CONTEXT.md", // deprecated
]
function extract(messages: SessionLegacy.WithParts[]) {
const paths = new Set<string>()
for (const msg of messages) {
@@ -65,7 +59,11 @@ export const layer: Layer.Layer<
path.join(global.config, "AGENTS.md"),
...(!flags.disableClaudeCodePrompt ? [path.join(global.home, ".claude", "CLAUDE.md")] : []),
]
const instructionFiles = files(flags.disableClaudeCodePrompt)
const instructionFiles = [
"AGENTS.md",
...(!flags.disableClaudeCodePrompt ? ["CLAUDE.md"] : []),
"CONTEXT.md", // deprecated
]
const state = yield* InstanceState.make(
Effect.fn("Instruction.state")(() =>