fix(core): preserve shell output tail

Shell truncation read from cursor zero, so large command output kept the head instead of the useful tail. Read the final capture window and cover the direction with head/tail markers.
This commit is contained in:
Aiden Cline 2026-07-12 19:38:50 +00:00
commit d8b7a0a391
9 changed files with 32 additions and 12 deletions

View file

@ -57,7 +57,11 @@ export const ShellHandler = HttpApiBuilder.group(Api, "server.shell", (handlers)
Effect.fn(function* (ctx) {
const shell = yield* Shell.Service
return yield* response(
shell.output(ctx.params.id, { cursor: ctx.query.cursor, limit: ctx.query.limit }).pipe(
shell.output(ctx.params.id, {
cursor: ctx.query.cursor,
limit: ctx.query.limit,
keep: ctx.query.keep,
}).pipe(
Effect.catchTag(
"Shell.NotFoundError",
() => new ShellNotFoundError({ id: ctx.params.id, message: `Shell command not found: ${ctx.params.id}` }),