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
12 changes: 10 additions & 2 deletions packages/core/src/cross-spawn-spawner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,11 @@ export const make = Effect.gen(function* () {
const escalated = command.options.forceKillAfter
? Effect.timeoutOrElse(attempt, {
duration: command.options.forceKillAfter,
orElse: () => send("SIGKILL").pipe(Effect.andThen(Deferred.await(signal)), Effect.asVoid),
orElse: () =>
send("SIGKILL").pipe(
Effect.andThen(Deferred.await(signal).pipe(Effect.timeout("5 seconds"), Effect.ignore)),
Comment thread
sergey-tihon marked this conversation as resolved.
Effect.asVoid,
),
})
: attempt
return yield* Effect.ignore(escalated)
Expand Down Expand Up @@ -430,7 +434,11 @@ export const make = Effect.gen(function* () {
if (!opts?.forceKillAfter) return attempt
return Effect.timeoutOrElse(attempt, {
duration: opts.forceKillAfter,
orElse: () => send("SIGKILL").pipe(Effect.andThen(Deferred.await(signal)), Effect.asVoid),
orElse: () =>
send("SIGKILL").pipe(
Effect.andThen(Deferred.await(signal).pipe(Effect.timeout("5 seconds"), Effect.ignore)),
Effect.asVoid,
),
Comment thread
sergey-tihon marked this conversation as resolved.
})
},
unref: Effect.sync(() => {
Expand Down
10 changes: 10 additions & 0 deletions packages/opencode/src/tool/shell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,16 @@ export const ShellTool = Tool.define(
if (!containsPath(cwd, instanceCtx)) scan.dirs.add(cwd)
yield* ask(ctx, scan)
}),
).pipe(
Effect.timeoutOrElse({
duration: "10 seconds",
orElse: () =>
Effect.gen(function* () {
yield* Effect.logWarning(
"Shell command scan/ask phase timed out after 10 seconds; continuing execution without completing that work, so results may be incomplete.",
)
}),
}),
)

return yield* run(
Expand Down
Loading