Skip to content

[1946 by GPT-5.6 Sol] Add a focused CLI workflow for inspecting active tasks - #1947

Merged
integry merged 1 commit into
mainfrom
1946/gpt-5.6-sol-add-a-focused-cli-workflo-20260825-2001-z6a
Aug 25, 2026
Merged

integry merged 1 commit into
mainfrom
1946/gpt-5.6-sol-add-a-focused-cli-workflo-20260825-2001-z6a

Conversation

@propr-dev

@propr-dev propr-dev Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

AI Implementation Summary

Closes #1946

Branch: 1946/gpt-5.6-sol-add-a-focused-cli-workflo-20260825-2001-z6a
Commits: ✅ Changes committed (422b53d)


AI Processing Completed

Execution Details:

Summary:
Implemented GitHub issue #1946.

Key changes:

  • Added propr task inspect [task-id] in taskCommands.ts.
    • No ID: fetches each active state server-side.
    • --state: fetches one authoritative lifecycle state.
    • ID supplied: uses the existing task details/history endpoint.
  • Added canonical lifecycle constants, including queued work, in taskLifecycle.ts.
  • Added human-readable state, agent/model, elapsed, and updated-time output.
  • Added documented, versioned --json list and detail shapes.
  • Extended API task responses with updated timestamps and agent aliases.
  • Added comprehensive CLI/API-client tests in taskInspectCommands.test.ts.
  • Updated CLI help, README, bundled skill, user documentation, and troubleshooting guidance.

Verification completed:

  • Full CLI suite: 324 passed, 1 platform-specific skip.
  • API task route tests: 3 passed.
  • Shared, core, CLI, and API typechecks passed.
  • CLI and API lint passed.
  • All touched packages built successfully.
  • Documentation typecheck and production build passed.

Detailed Logs:

  • Conversation: 79 messages
  • Session: 01a03a85-018a-7760-a3b0-6fe667a9aee8

Log files stored at:

  • conversation: /tmp/claude-logs/issue-1946-2026-08-25T20-15-53-198Z-conversation.json
  • output: /tmp/claude-logs/issue-1946-2026-08-25T20-15-53-198Z-output.txt
Latest Conversation Messages

This PR was created automatically by ProPR after processing issue #1946.


💡 Need changes?

Comment on this PR to request refinements — the AI agent monitors comments and will update the implementation based on your feedback. Keep iterating until you're satisfied!

…ing active t

Implemented by ProPR AI using gpt-5.6-sol model.

Implementation completed successfully.
@integry

integry commented Aug 25, 2026

Copy link
Copy Markdown
Owner

/ultrafix goal=8 max=10

@propr-dev

propr-dev Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Ultrafix loop started (goal: 8/10, max cycles: 10)

First action: /review

💡 Tip: Remove the ultrafix label from this PR to stop further ultrafix cycles.

@propr-dev propr-dev Bot added the ultrafix label Aug 25, 2026
@propr-dev

propr-dev Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — claude:claude-sonnet-5

Overall Evaluation

This PR adds propr task inspect, a focused, read-only CLI entry point for viewing active tasks (via explicit per-lifecycle-state server queries) and full task detail/history for a single task ID. It satisfies the linked issue's core requirements: it reuses the existing listTasks/getTaskStatus API primitives rather than building a parallel API, requests explicit server-side lifecycle-state filters instead of client-side filtering of a single page, and adds a stable, versioned JSON contract for automation. The shared taskLifecycle.ts module cleanly centralizes the lifecycle vocabulary and is correctly reused to de-duplicate a previously inline array in taskRoutes.ts. Threading agentAlias through the job-data/task-info pipeline is a coherent, backward-compatible addition (updatedAt and agentAlias are both optional/nullable at the type level, protecting older servers/CLIs). Documentation (README, feature docs, troubleshooting, SKILL.md) is updated in lockstep with the actual JSON shapes emitted by the code, and the new command is properly registered in the CLI's command-surface audit test. All current-head checks pass.

✅ Correct server-side state fan-out — taskCommands.ts's default task inspect path issues one listTasks({ status: state, ... }) call per ACTIVE_TASK_LIFECYCLE_STATES entry (verified against packages/api/routes/taskHelpers.ts's getTasksFromDb, which filters by h.state = status on the latest history row), directly satisfying the issue's requirement to fetch by authoritative server-side state rather than filtering a single fetched page.

✅ Backward-compatible schema additions — TaskInfo.agentAlias and TaskSummary.updatedAt are added as optional fields, and summaryUpdatedAt() falls back through completedAt/processedAt/createdAt when updatedAt is absent, so older servers (per the added doc comment) don't break the new command.

✅ Solid test coverage of new behavior — taskInspectCommands.test.ts exercises exact-state filtering, the default active-state fan-out (asserting the exact request order matches ACTIVE_TASK_LIFECYCLE_STATES), both JSON shapes (list and detail), empty results, task-ID lookup with history, and not-found/error presentation paths.

The PR is well-scoped, well-tested, and ready to merge as-is.

Merge blockers

No merge blockers.

Suggestions

These are optional follow-ups and are not sent to /fix.

S1: 🟢 --state accepts terminal lifecycle states

TASK_INSPECTION_STATE_SET in taskCommands.ts is built from the full TASK_LIFECYCLE_STATES (including completed, failed, cancelled), so propr task inspect --state completed is accepted even though the command's stated purpose (per its own help text and the issue) is inspecting active tasks. This isn't incorrect — the issue text says "support selecting a particular authoritative task state" without explicitly restricting it — but it slightly blurs the "focused active-task" framing. Consider either restricting --state to ACTIVE_TASK_LIFECYCLE_STATES or updating the help text/docs to explicitly note terminal states are also selectable.

S2: 🟢 Parallel per-state fetch fails fast and over-fetches

Promise.all(states.map(...)) in taskCommands.ts means one transient failure on any of the 5 default state queries aborts the whole inspect call with no partial output, and each state query requests up to --limit rows (default 50) independently, so up to 5× the eventual displayed rows may be fetched and then discarded by the final slice(0, limit). Neither is incorrect, but Promise.allSettled (with a note about which state failed) would be more resilient, and a single combined-state server endpoint (or a smaller per-state page size when multiple states are requested) would reduce over-fetching. This is an optimization/robustness idea, not required for correctness given the current test coverage.

S3: 🟢 Detail JSON details/repository can be null despite non-empty history

In taskInspectionJson, repository and details are null whenever status.taskInfo is falsy, which can happen even when status.history is non-empty (e.g., the Redis/queue fallback paths in taskHistoryRoutes.ts can return taskInfo: null while history has entries). The documented JSON contract in propr-cli.md/README.md example shows details as a populated object and doesn't call out this null case. Not a functional bug (the "not found" check only fires when both are empty/null), but worth a one-line documentation caveat for consumers relying on the schema.

S4: 🟢 Minor timing-snapshot inconsistency

formatUpdatedAt() calls Date.now() independently from the now snapshot used elsewhere in summaryElapsedMs/toInspectedTaskSummary, so within a single command invocation the "Elapsed" and "Updated ... ago" columns could theoretically be computed against slightly different wall-clock instants. The skew is milliseconds and has no practical effect, but threading a shared now through formatUpdatedAt as well would be tidier.

Score

No actionable findings were identified, the new command's behavior is verified correct against the diff and its consumers, and all current-head checks pass.
Score: 9/10


🤖 Review Details

  • Model: Claude Sonnet 5
  • Time: 2m 46s
  • Tokens: 71,372 (55,663 in / 15,709 out)
  • Cost: $0.30

View Task


💡 Next step: Comment /fix to address F# merge blockers only.
F# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. Suggestions require a separate ordinary follow-up request.

🤖 Review by ProPR

@propr-dev propr-dev Bot removed the ultrafix label Aug 25, 2026
@integry
integry merged commit 6193754 into main Aug 25, 2026
27 checks passed
@integry
integry deleted the 1946/gpt-5.6-sol-add-a-focused-cli-workflo-20260825-2001-z6a branch September 1, 2026 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a focused CLI workflow for inspecting active tasks

1 participant