fix review findings: stale get/list in proposed RFCs + doneFor double-await

Second Codex pass caught two proposed RFCs that describe the bash seam as it
WAS (with get/list) and would read stale once this prune lands, plus a latent
test-helper edge:
- docs/rfc/proposed/architecture/2026-06-20-branded-ids.md and
  2026-06-20-generic-long-running-tool-runtime.md: drop get/list from the
  BashExecutor seam description (surviving: resolve/run/start/ownerOf/
  readOutput/kill/onTaskDone). branded-ids will be further updated when it is
  implemented; this keeps it accurate in the meantime.
- trackCompletions now records every completion to `done` unconditionally (and
  also wakes a parked waiter), so a second doneFor(id) after completion resolves
  instead of hanging.
This commit is contained in:
Tianyi Cui
2026-06-21 03:00:07 +08:00
parent 5f9d10c587
commit 6ca8c3b99a
3 changed files with 6 additions and 5 deletions

View File

@@ -85,12 +85,13 @@ function trackCompletions(ctx: Context): void {
const state = { done: new Map<string, BashTask>(), waiters: new Map<string, (task: BashTask) => void>() }
completions.set(ctx, state)
ctx.bash.onTaskDone((task) => {
// Always record the completion so a later doneFor(id) still resolves; also
// wake any waiter already parked on this id.
state.done.set(task.id, task)
const waiter = state.waiters.get(task.id)
if (waiter) {
state.waiters.delete(task.id)
waiter(task)
} else {
state.done.set(task.id, task)
}
})
}