fix: complete nightbot - tests, bug fixes, and improvements#10
Merged
Conversation
- Create src/utils.ts with log() for ISO timestamp prefixed output - Replace console.log with log() in orchestrator, scout, escalation, context - Fix dashboard /api/escalations to read .md files (not .json) - Add `nightbot clear` CLI command (--all for escalated too) - Fix applyChanges to stash/pop dirty files before git checkout - Add real tests: task, feedback, gate, context, planner (29 tests) - Update package.json test script to use node --test + tsx - Fix .gitignore: add nightbot.log, queue/failed, queue/escalated Co-Authored-By: Claude Opus 4.6 <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.
Summary
/api/escalationsnow reads.mdfiles (matching whatescalation.tssaves) instead of.json— escalations actually show up in the dashboard nownightbot clearcommand: Clear completed/failed tasks from queue (--allincludes escalated)log()utility with ISO timestamps: Replace allconsole.logcalls in orchestrator, scout, escalation, and context modules with timestampedlog()applyChangesdirty workdir crash: Stash/pop dirty files beforegit checkoutto prevent failures (was crashing onnightbot.log)src/utils.ts, fix import ordering insrc/utils.test.ts.gitignore: Addnightbot.log,queue/failed/,queue/escalated/node --import tsx --test src/*.test.tsTest plan
npx tsc --noEmit— zero errorsnpx biome check src/— zero errorsnode --import tsx --test src/*.test.ts— 29/29 tests pass./bin/nightbot.mjs --help— shows all commands includingclear🤖 Generated with Claude Code