Repository navigation
feat(cli): record whether each tracked command ran over SSH - #316
Conversation
`shelltime track` now checks SSH_CONNECTION/SSH_CLIENT/SSH_TTY (inherited from the login shell) and sends a per-command `viaSsh` flag. The web timeline uses it to nest commands run on a remote host under the `ssh` command that opened the session. The check is done in the track process because the daemon's own environment has no SSH variables. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ev8KCoqb66RRr6CBZp23wo
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
Codecov Report✅ All modified and coverable lines are covered by tests.
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes 🚀 New features to boost your workflow:
|
|
@claude review Generated by Claude Code |
|
Claude finished @AnnatarHe's task in 17s —— View job Code reviewI read the full diff and found no blocking issues. The change is small and consistent with the repo's conventions. What I checked
Minor, non-blocking notes
No changes requested. This looks good to merge once the server side that stores I did not run the build or tests. This was a read-only review. |
|
Thanks. All four notes stay as they are:
Generated by Claude Code |
Summary
Part of the command timeline fix. When you run
ssh devboxon your laptop and then work on devbox, the web timeline now nests devbox's commands under thatsshcommand. Without SSH information, a remote shell on devbox looks just like someone sitting at devbox.model.IsSSHSession(getenv). It is true whenSSH_CONNECTION,SSH_CLIENTorSSH_TTYis set. sshd exports these into the login shell, andshelltime trackinherits them.shelltime trackrecords the flag on each pre/post record (model.Command.ViaSSH,*bool). It is computed in the track process, because the daemon's own environment has no SSH variables.TrackingData.viaSshis sent per row. It is taken from the post record, falling back to the pre record.terminalandshellinmetaare per upload batch, so they can't serve this purpose.shelltime qreuses the same helper. Its SSH check now also countsSSH_CLIENT.No hook changes are needed.
Merge order
viaSsh(older servers ignore the field)Tests
TestBuildTrackingDataViaSSH:trueon either side wins.TestIsSSHSessiontable test.go vet ./...andgo test ./model/... ./commands/... ./daemon/...pass.🤖 Generated with Claude Code
https://claude.ai/code/session_01Ev8KCoqb66RRr6CBZp23wo
Generated by Claude Code