Include task ID and command in status line messages#14
Conversation
When a task was promoted from waiting to running, the status line only showed the task ID number instead of the command name. This made it hard to identify which task was running when multiple tasks were queued. All status line messages now include the task ID and a truncated command preview (max 50 chars) for better visibility. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR improves status line messages in the task queue by including task IDs and truncated command previews (max 50 characters) in all status messages. Previously, only the task ID was shown when a task was promoted from waiting to running, making it difficult to identify which task was executing when multiple tasks were queued.
Changes:
- Added command preview (truncated to 50 chars) to the initial "queued" message
- Updated waiting status messages to include task ID
- Enhanced lock acquisition message to show both task ID and command preview
- Added task ID to the completion message
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Compute cmd_preview once at function start instead of twice - Handle None command gracefully by omitting from message instead of showing "(None)" or "Running: None" Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ) | ||
| if ctx: | ||
| await ctx.info(log_fmt("Lock ACQUIRED. Starting execution.")) | ||
| msg = f"Task #{task_id} lock ACQUIRED.{f' Running: {cmd_preview}' if cmd_preview else ''}" |
There was a problem hiding this comment.
When cmd_preview is empty or None, the status message ends abruptly with "Task #{task_id} lock ACQUIRED." without any indication that execution is starting. The original message included "Starting execution." which provided clearer context. Consider adding ". Starting execution." when cmd_preview is not available to maintain clarity.
| msg = f"Task #{task_id} lock ACQUIRED.{f' Running: {cmd_preview}' if cmd_preview else ''}" | |
| msg = ( | |
| f"Task #{task_id} lock ACQUIRED." | |
| f"{f' Running: {cmd_preview}' if cmd_preview else ' Starting execution.'}" | |
| ) |
| if pos != last_pos: | ||
| if ctx: | ||
| await ctx.info(log_fmt(f"Position #{pos} in queue. Waiting...")) | ||
| await ctx.info(log_fmt(f"Task #{task_id} is position #{pos} in queue. Waiting...")) |
There was a problem hiding this comment.
The message has a grammatical issue. "Task #{task_id} is position #{pos}" is missing the preposition "at". It should read "Task #{task_id} is at position #{pos} in queue. Waiting..." for proper grammar.
| await ctx.info(log_fmt(f"Task #{task_id} is position #{pos} in queue. Waiting...")) | |
| await ctx.info(log_fmt(f"Task #{task_id} is at position #{pos} in queue. Waiting...")) |
Summary
Test plan
🤖 Generated with Claude Code