feat(js): add currentTime to --status output for executing commands#106
feat(js): add currentTime to --status output for executing commands#106
Conversation
Adding .gitkeep for PR creation (default mode). This file will be removed when the task is complete. Issue: #105
|
🤖 AI Work Session Started Starting automated work session at 2026-04-23T10:41:17.173Z The PR has been converted to draft mode while work is in progress. This comment marks the beginning of an AI work session. Please wait for the session to finish, and provide your feedback. |
Adds a `currentTime` field to the `--status` output (links-notation, JSON, and text) whenever the execution is still `executing`. This surfaces the moment the query was made so users can easily compute how long a command has been running from `startTime`, which is what issue #105 asks for. Resolves #105
status executing, so it will be visible what is current time of call of $ --status 8b4d5df0-5a24-4af6-b159-a035463aac68
Solution summaryPR is ready for review. Summary:
This summary was automatically extracted from the AI working session output. |
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost: $6.260347📊 Context and tokens usage:
Total: (176.8K + 9.0M cached) input tokens, 27.0K output tokens, $6.260347 cost 🤖 Models used:
📎 Log file uploaded as Gist (2380KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |
|
🤖 AI Work Session Started Starting automated work session at 2026-04-23T11:53:04.672Z The PR has been converted to draft mode while work is in progress. This comment marks the beginning of an AI work session. Please wait for the session to finish, and provide your feedback. |
Mirrors the JS change from PR #106. When `--status <uuid-or-session>` is called for a command whose status is `executing`, all three output formats (links-notation, JSON, text) now include a `currentTime` field/line right after `startTime`/`Start Time:`. This surfaces the moment the query was made so users can easily compute how long a command has been running. Completed executions are unchanged — `endTime` already reflects completion, and `currentTime` is not attached. - `rust/src/lib/status_formatter.rs`: new `attach_current_time()` helper plus `_with_current_time` variants of the three formatters. `query_status()` now wires the timestamp through to all formats. - `rust/src/lib/mod.rs`: re-export the new helpers. - `rust/tests/status_formatter_test.rs`: 10 new unit tests for the formatter variants and JSON/links-notation/text output shape. - `rust/tests/session_name_status_test.rs`: 9 new integration tests for `query_status` across all three formats, plus direct `attach_current_time` behavior. - `rust/changelog.d/105.md`: changelog fragment. Fixes #105
Solution summaryAll CI checks pass:
Build/Auto/Manual Release are skipping (normal for non-main PRs). Summary of what was done:
This summary was automatically extracted from the AI working session output. |
Summary
Closes #105.
When
$ --status <uuid-or-session>is called for a command that is stillexecuting, the output now includes a newcurrentTimefield next tostartTime. This makes it trivial to see how long a command has been running (just subtractstartTimefromcurrentTime).Before
After
currentTimeis only added when the status isexecuting; for finished executions the output is unchanged (endTimealready reflects completion).Changes
js/src/lib/status-formatter.js: newattachCurrentTime()helper that wraps the enriched record and augments itstoObject()to includecurrentTimeright afterstartTime. Wired intoqueryStatus()so all three formats (links-notation, JSON, text) benefit.js/test/status-query.test.js: integration tests covering all three formats — executing records includecurrentTime, completed records do not.js/test/session-name-status.test.js: unit tests forattachCurrentTime()(executing vs executed, non-mutation, key ordering, null input).js/.changeset/issue-105-current-time.md: patch changeset.Test plan
bun test test/status-query.test.js test/session-name-status.test.js→ 32/32 pass, 90 expect() callsbun run lint→ cleanbun run format:check→ cleanexecutingrecord:--status <uuid>(default links-notation) includescurrentTime "..."--status <uuid> --output-format jsonincludes"currentTime": "..."--status <uuid> --output-format textincludesCurrent Time: ...currentTime/Current Time:absent in all formats.Reproducing the issue
Create or attach to a long-running command (e.g.
$ --isolated screen -d -s my-session -- solve ...) and repeatedly run$ --status my-session. Before this PR the output only showsstartTime, so you have to read the clock yourself; after this PR it shows both, so elapsed time is obvious.Note: the 2 pre-existing failures in
test/args-parser.test.js(regex/requires a UUID argument/) are unrelated — they exist onmainbecause an earlier commit changed the error message to "UUID or session name" without updating the expected regex in the test.