Skip to content
This repository was archived by the owner on Jun 1, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"@solidjs/start": "https://pkg.pr.new/@solidjs/start@dfb2020",
"solid-js": "1.9.10",
"vite-plugin-solid": "2.11.10",
"@lydell/node-pty": "1.2.0-beta.10"
"@lydell/node-pty": "1.2.0-beta.12"
}
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/components/dialog-select-server.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ function ServerForm(props: ServerFormProps) {
props.onBack()
return
}
if (event.key !== "Enter" || event.isComposing) return
if (event.key !== "Enter" || event.isComposing || event.keyCode === 229) return
event.preventDefault()
props.onSubmit()
}
Expand Down
3 changes: 2 additions & 1 deletion packages/app/src/context/global-sync/event-reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,8 @@ export function applyDirectoryEvent(input: {
break
}
case "message.part.updated": {
const part = (event.properties as { part?: Part }).part
const props = event.properties as { part?: Part } | undefined
const part = props?.part
if (!part) break
if (SKIP_PARTS.has(part.type)) break
// Drain any buffered deltas that arrived before this part existed.
Expand Down
2 changes: 1 addition & 1 deletion packages/codeplane/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
"@hono/node-ws": "1.3.0",
"@hono/standard-validator": "0.1.5",
"@hono/zod-validator": "0.4.2",
"@lydell/node-pty": "1.2.0-beta.10",
"@lydell/node-pty": "1.2.0-beta.12",
"@modelcontextprotocol/sdk": "1.29.0",
"@npmcli/arborist": "9.4.0",
"@npmcli/config": "10.8.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/codeplane/script/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ const targets = singleFlag
const binaries: Record<string, string> = {}

try {
await $`rm -rf dist`
fs.rmSync(path.join(dir, "dist"), { recursive: true, force: true })
if (!skipInstall) {
await $`bun install --no-save --os="*" --cpu="*" @parcel/watcher@${pkg.dependencies["@parcel/watcher"]}`
}
Expand All @@ -316,7 +316,7 @@ try {
.filter(Boolean)
.join("-")
console.log(`building ${name}`)
await $`mkdir -p dist/${name}/bin`
fs.mkdirSync(path.join(dir, "dist", name, "bin"), { recursive: true })

const mainResult = await Bun.build({
// The bundler classifies the build by `target`. Without this, it defaults
Expand Down
2 changes: 1 addition & 1 deletion packages/codeplane/src/plugin/codex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ export async function CodexAuthPlugin(input: PluginInput): Promise<Hooks> {
? requestInput
: new URL(typeof requestInput === "string" ? requestInput : requestInput.url)
const url =
parsed.pathname.includes("/v1/responses") || parsed.pathname.includes("/chat/completions")
parsed.pathname.endsWith("/responses") || parsed.pathname.includes("/chat/completions")
? new URL(CODEX_API_ENDPOINT)
: parsed

Expand Down
2 changes: 1 addition & 1 deletion packages/codeplane/src/provider/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function wrapSSE(res: Response, ms: number, ctl: AbortController) {
async pull(ctrl) {
const part = await new Promise<Awaited<ReturnType<typeof reader.read>>>((resolve, reject) => {
const id = setTimeout(() => {
const err = new Error("SSE read timed out")
const err = Object.assign(new Error("SSE read timed out"), { name: "ResponseStreamError" })
ctl.abort(err)
void reader.cancel(err)
reject(err)
Expand Down
1 change: 0 additions & 1 deletion packages/codeplane/src/pty/pty.node.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/** @ts-expect-error */
import * as pty from "@lydell/node-pty"
import type { Opts, Proc } from "./pty"

Expand Down
11 changes: 10 additions & 1 deletion packages/codeplane/src/tui/component/prompt/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,16 @@ export function Prompt(props: PromptProps) {
const nonTextParts = store.prompt.parts.filter((p) => p.type !== "text")

const value = text
const content = await Editor.open({ value, renderer })
const content = await Editor.open({
value,
renderer,
cwd:
(project.instance.path().worktree === "/"
? undefined
: project.instance.path().worktree) ||
project.instance.directory() ||
process.cwd(),
})
if (!content) return

input.setText(content)
Expand Down
46 changes: 36 additions & 10 deletions packages/codeplane/src/tui/feature-plugins/system/session-v2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ function AssistantMessage(props: {
<AssistantText part={part as SessionMessageAssistantText} syntax={props.syntax} />
</Match>
<Match when={part.type === "reasoning"}>
<AssistantReasoning part={part as SessionMessageAssistantReasoning} subtleSyntax={props.subtleSyntax} />
<AssistantReasoning part={part as SessionMessageAssistantReasoning} subtleSyntax={props.subtleSyntax} done={Boolean(final())} />
</Match>
<Match when={part.type === "tool"}>
<AssistantTool part={part as SessionMessageAssistantTool} agentColor={local.agent.color(props.message.agent)} />
Expand Down Expand Up @@ -369,9 +369,14 @@ function AssistantText(props: { part: SessionMessageAssistantText; syntax: Synta
)
}

function AssistantReasoning(props: { part: SessionMessageAssistantReasoning; subtleSyntax: SyntaxStyle }) {
function AssistantReasoning(props: { part: SessionMessageAssistantReasoning; subtleSyntax: SyntaxStyle; done?: boolean }) {
const { theme } = useTheme()
const content = createMemo(() => props.part.text.replace("[REDACTED]", "").trim())
const title = createMemo(() => {
if (!content()) return undefined
const line = content().split("\n")[0]
return line.length > 60 ? line.slice(0, 57) + "..." : line
})
return (
<Show when={content()}>
<box
Expand All @@ -383,12 +388,21 @@ function AssistantReasoning(props: { part: SessionMessageAssistantReasoning; sub
borderColor={theme.backgroundElement}
flexShrink={0}
>
<MarkdownText
text={"_Thinking:_ " + content()}
syntax={props.subtleSyntax}
streaming={true}
conceal={true}
/>
<Switch>
<Match when={!props.done}>
<box flexDirection="row">
<Spinner color={theme.textMuted}>Thinking{title() ? ": " + title() : ""}</Spinner>
</box>
</Match>
<Match when={true}>
<MarkdownText
text={"_Thought:_ " + content()}
syntax={props.subtleSyntax}
streaming={true}
conceal={true}
/>
</Match>
</Switch>
</box>
</Show>
)
Expand Down Expand Up @@ -523,7 +537,13 @@ function InlineTool(props: {
agentColor?: RGBA
}) {
const { theme } = useTheme()
const error = createMemo(() => (props.part.state.status === "error" ? props.part.state.error.message : undefined))
const error = createMemo(() => {
if (props.part.state?.status !== "error") return undefined
const err = props.part.state.error
if (!err) return "unknown error"
const msg = typeof err === "object" && err !== null && "message" in err ? (err as { message: unknown }).message : err
return typeof msg === "string" ? msg : String(msg)
})
const denied = createMemo(() => {
const message = error()
if (!message) return false
Expand Down Expand Up @@ -569,7 +589,13 @@ function BlockTool(props: {
const { theme } = useTheme()
const renderer = useRenderer()
const [hover, setHover] = createSignal(false)
const error = createMemo(() => (props.part?.state.status === "error" ? props.part.state.error.message : undefined))
const error = createMemo(() => {
if (props.part?.state?.status !== "error") return undefined
const err = props.part.state.error
if (!err) return "unknown error"
const msg = typeof err === "object" && err !== null && "message" in err ? (err as { message: unknown }).message : err
return typeof msg === "string" ? msg : String(msg)
})
return (
<box
border={["left"]}
Expand Down
Loading
Loading