feat(worker): surface memory stats in run log and fix log-level colors#91
Merged
Conversation
Memory samples now emit a single debug log line per phase (startup, each sample interval, and stop) when processing.debug is on, formatted as `Task process memory stats - rss=… heapTotal=… …` so the payload is visible in the run UI (which only renders log.msg). The reporter handle is now awaited in task.ts:finally so the closing sample lands after the final success/error log. Run log UI: `warning` entries now use `text-warning` (were styled with `text-info`), and `debug` entries use `text-medium-emphasis` so they're visually distinct from `info`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Make the per-task memory debug logs added in #90 actually useful in the
run log UI, and fix two stale color choices in the run-log component.
Why: the new
memory-reporterwas pushingdebug('memory', formatMem(...))into
run.log, butrun-logs-list.vueonly renderslog.msg— theactual
rss=… heapUsed=… …payload (stored inextra) was silentlydropped. There were also no startup / exit entries to anchor the
periodic samples in time.
What changed:
worker/src/task/memory-reporter.ts— whenprocessing.debug, emit aunified
Task process memory stats - rss=… heapTotal=… heapUsed=… …debug entry at startup, on every sample interval, and at stop. Payload
is now in
msg(visible in the UI) rather thanextra.worker/src/task/task.ts— capture the reporter handle andawait memReporter.stop()infinally, so the closing entry landsafter the final success/error log.
ui/src/components/run/run-logs-list.vue—warningentries now usetext-warning(weretext-info), anddebugentries usetext-medium-emphasisso they're visually distinct frominfo.Regression risks:
warning/debugentry across all runs, not only the new memory lines.MemoryReporterHandle.stop()is now async; the single in-tree callerwas updated to await it.
log.debug(mongo write + wsemit). If mongo stalls on shutdown, the task child waits on it — same
pattern as the existing final success/error log.