Repository navigation
Bash-task storage and log hygiene (several small items) #759
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't working
Description
AFT: 0.60.0 observed; code references at v0.61.0 (crates/aft). OpenCode 2, macOS. Rechecked on 0.61.0 (Oct 22): empty session dirs grew to 182 of 210; retention … removed=0 (info) and persisted_gc_delivered_terminal (WARN) still log on every sweep; aft-plugin.log is now 16 MB with no rotation. retired 0 stopped after updating, and no new "giving up deleting" lines since Oct 20. Rechecked on 0.62.0 (48 min of logs): empty session dirs 187 of 219 and still growing; retention … removed=0 90 lines and bash task row deleted WARN 169 lines; plugin log 17 MB, no rotation. No "giving up" lines to confirm or rule out item 3. File:line references are from v0.61.0.
- Per-session bash-task directories are never removed.
bash_background/registry.rs:7125-7245(cleanup_finished_at_with) deletes a task's bundle but never its parentbash-tasks/<session-hash>/; quarantine GC (:11156-11188) also leaves session dirs. No non-test code removes a session directory. Here: 141 of 162 dirs underopencode/bash-tasks/are empty. Fix: non-recursivermdirafter the last task is deleted, ignoring ENOTEMPTY, under the creators' lock. - Routine work logged at info/warn.
db/compression_events.rs:1088logsbash task retention: … removed=0at info on every 60 s sweep (db/mod.rs:596-605).db/bash_tasks.rs:168-170logsbash task row deleted … persisted_gc_delivered_terminalat WARN for every GC'd row (~8k in 5 days here, one per real deletion), which buries real warnings. ("retired 0 undelivered completions" is already gated in 0.61.0.) Fix: debug when nothing changed; info for routine deletions. - "giving up deleting … layout not found" leaves the directory. 78 such lines here. A real
background task layout not foundis caught byis_task_layout_not_found(registry.rs:7199), but an empty task directory makestask_layout_entry_exists(persistence.rs:1709-1726) return true andresolve_uninitialized_task_layout(:1070-1072) fail with a plain OS NotFound, which isn't recognised, so it retries 5 times (FINISHED_DELETE_MAX_ATTEMPTS) and gives up. Fix: map NotFound oncontrol//io/totask_layout_not_found(). (Hypothesis for our log lines; the code path is confirmed.) - One unreadable binding file skips its whole batch, every cycle.
storage_retention.rs:5310-5331(prune_bindings) uses?inside the loop over 32 entries; one truncated or newer-schemaretention/roots/*.jsonaborts the batch, the consumed entries are skipped for the cycle, and the bad file stays. Fix: log, quarantine andcontinue. - Plugin log has no rotation.
aft-plugin.logreached 13 MB in 5.5 days, about half periodic no-op lines (retired 0×6,187,retention removed=0×6,175,perf tick×2,907,bash_wait_detach detached=false×3,118).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Activity
null-axiom commentedon Oct 22, 2026
More on the log side, observed on 0.62.0:
bridge.tsforwards every engine stderr line throughlogVia, and the engine already writes the same lines toaft-<pid>.log. 54,591 of ~65,000 lines (15.8 of 17.3 MB) inaft-plugin.logare[aft-plugin] [aft] …copies.WARNappears asINFO … [aft] WARN …. The plugin log has 65,098 INFO, 107 DEBUG and 1 WARN, so filtering by level can't find real warnings.WARN cannot establish filesystem boundary for checkpoint sweep …/opencode/checkpointson every engine start:checkpoint.rscallsDeviceBoundary::for_rooton a directory that doesn't exist. Treating NotFound as "nothing to sweep" would silence it.perf ticklines still print. The "active" gate inlogging.rscountsdrain_slices > 0as activity; 3,635 of 3,864 ticks readwatcher={0,0,0} tier2=[none] semantic={0…}.bash_wait_detach: … detached=falselogs at INFO on every user message (4,091 over 7 days); logging onlydetached=truewould be enough.writer.leasewarnings after a kill.removing filesystem lock … from dead or recycled PID(81 lines) after engines exit without a shutdown line — an expected state after SIGTERM/SIGKILL./and the home directory that AFT refuses to index: 662 starts in 7 days, each logging "Config loaded" three times plus the hints and ONNX lines.Resolved binary from versioned cache: ~/.cache/aft/bin/v0.62.0/aft, but the running engines come from the npm platform package; the 97 MB cached copy appears unused.aft-alfonso commentedon Oct 23, 2026
Thanks for the detailed report. All five points were real, and the fixes are now on main. They'll ship in the next release.
bash-tasks/folders. Folders left with no task records are now removed during cleanup, unless a task still points at them.I'll close this issue once the release is published.
null-axiom commentedon Oct 23, 2026
A few more small items seen on 0.62.0:
FAILED:at line 1500 andERROR:at 2200 shows the first 521 and last 21 lines; both failure lines are dropped. The truncation marker, line counts and exit code are honest, but the "raw failure lines preserved" rescue incompress/mod.rsonly runs after a specific compressor matches. Applying it to the generic cap would keep errors visible.catrewrite refuses the host's approved temp directory and logsWARN bash rewrite rule cat declined … predicate=path_is_safeeach time (for$TMPDIR/opencode/…). Either accept that directory or log at debug.oldStringback in the not-found error (edit_match.rs), so a large old string is repeated into the transcript.mason: failing-first repros for command redaction and bash output fol…
mason: keep middle failure lines in a failed command's reply (cortexk…
mason: name a missed edit by its first line and size (cortexkit#759)
mason: log routine cat rewrite declines at debug (cortexkit#759)