feat: admin run-log diagnostics — extra viewer + metrics split - #97
Merged
Conversation
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.
Surface admin-only diagnostic detail in run logs, and stop polluting the user-facing error with resource metrics.
What changed
run-logs-list.vue): superadmins (adminMode) get a View extra toggle on any log entry carrying anextrapayload, expanding a copyable code block;debugentries now render with thetext-adminaccent. AddsmdiChevronUp/mdiChevronDown/mdiContentCopyto the auto-imported icon set (vite.config.ts).exit-code.ts,runs.ts,worker.ts):diagnoseExitnow returns the human-readable cause and the resource metrics (RSS/CPU/heap) as separate fields (adminMetrics/userMetrics). The worker writes metrics as an independentdebuglog entry (date offset +1ms so its key stays distinct) instead of appending them to the error message.adminMetrics/userMetrics.Why
Expose per-entry
extraand memory/CPU-at-failure to admins without mixing them into the user-facing error message.Regression risks
finish()gains a 4th optional parammetricsMessage— existing callers are unaffected (defaulted), but failures now push two log entries (error + debug metrics) instead of one. Anything consumingrun.logthat assumed a single appended entry per failure should be checked.ExitDiagnosisgained two required fields (adminMetrics,userMetrics); all call sites updated here, but any other consumer of the type must set them.extraviewer is gated onsession.state.user?.adminMode(non-admins see no change) and usesnavigator.clipboard(requires a secure context).