Skip to content
Open
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
4 changes: 2 additions & 2 deletions packages/opencode/src/agent/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export namespace Agent {
},
general: {
name: "general",
description: `General-purpose agent for researching complex questions and executing multi-step tasks. Use this agent to execute multiple units of work in parallel.`,
description: `General-purpose agent for researching complex questions and executing multi-step tasks. Use this agent to execute multiple units of work in parallel. Ideal for async execution when work can proceed concurrently.`,
permission: PermissionNext.merge(
defaults,
PermissionNext.fromConfig({
Expand Down Expand Up @@ -113,7 +113,7 @@ export namespace Agent {
}),
user,
),
description: `Fast agent specialized for exploring codebases. Use this when you need to quickly find files by patterns (eg. "src/components/**/*.tsx"), search code for keywords (eg. "API endpoints"), or answer questions about the codebase (eg. "how do API endpoints work?"). When calling this agent, specify the desired thoroughness level: "quick" for basic searches, "medium" for moderate exploration, or "very thorough" for comprehensive analysis across multiple locations and naming conventions.`,
description: `Fast agent specialized for exploring codebases. Use this when you need to quickly find files by patterns (eg. "src/components/**/*.tsx"), search code for keywords (eg. "API endpoints"), or answer questions about the codebase (eg. "how do API endpoints work?"). When calling this agent, specify the desired thoroughness level: "quick" for basic searches, "medium" for moderate exploration, or "very thorough" for comprehensive analysis across multiple locations and naming conventions. Ideal for async execution when running multiple independent explorations.`,
prompt: PROMPT_EXPLORE,
options: {},
mode: "subagent",
Expand Down
21 changes: 20 additions & 1 deletion packages/opencode/src/cli/cmd/tui/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,21 @@ function App() {
keybind: "session_new",
category: "Session",
onSelect: () => {
if (route.data.type === "session") {
const currentSessionID = route.data.sessionID
const children = sync.data.session.filter((s) => s.parentID === currentSessionID)
for (const child of children) {
const status = sync.data.session_status[child.id]
if (status?.type === "busy" || status?.type === "retry") {
toast.show({
variant: "warning",
message: `Cannot start new session: background task "${child.title}" is still running`,
})
return
}
}
}

const current = promptRef.current
// Don't require focus - if there's any text, preserve it
const currentPrompt = current?.current?.input ? current.current : undefined
Expand Down Expand Up @@ -562,7 +577,11 @@ function App() {

sdk.event.on(SessionApi.Event.Deleted.type, (evt) => {
if (route.data.type === "session" && route.data.sessionID === evt.properties.info.id) {
route.navigate({ type: "home" })
if (evt.properties.info.parentID) {
route.navigate({ type: "session", sessionID: evt.properties.info.parentID })
} else {
route.navigate({ type: "home" })
}
toast.show({
variant: "info",
message: "The current session was deleted",
Expand Down
13 changes: 7 additions & 6 deletions packages/opencode/src/cli/cmd/tui/context/sync.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,21 +218,22 @@ export const { use: useSync, provider: SyncProvider } = createSimpleContext({
break
}
case "message.part.updated": {
const parts = store.part[event.properties.part.messageID]
const part = event.properties.part
const parts = store.part[part.messageID]
if (!parts) {
setStore("part", event.properties.part.messageID, [event.properties.part])
setStore("part", part.messageID, [part])
break
}
const result = Binary.search(parts, event.properties.part.id, (p) => p.id)
const result = Binary.search(parts, part.id, (p) => p.id)
if (result.found) {
setStore("part", event.properties.part.messageID, result.index, reconcile(event.properties.part))
setStore("part", part.messageID, result.index, reconcile(part))
break
}
setStore(
"part",
event.properties.part.messageID,
part.messageID,
produce((draft) => {
draft.splice(result.index, 0, event.properties.part)
draft.splice(result.index, 0, part)
}),
)
break
Expand Down
Loading
Loading