Jira active tasks right panel#2008
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
- Repo-local Jira config loaded server-side from .t3-jira-config.json (resolved via git rev-parse --git-common-dir)
- Effect-TS JiraConfig + JiraService layers with listActiveTasks, getIssueDetail, runAutomation
- ADF-to-Markdown converter (no external deps)
- 4 new WS RPC methods: jira.getConfigStatus, jira.listActiveTasks, jira.getIssueDetail, jira.runAutomation
- Right panel with Plan/Jira tabs replacing standalone PlanSidebar
- JiraPanelTab: active task list, ticket detail view, pinned active ticket derived from branch name, Start Work flow (worktree + branch + runAutomation + new thread)
- GitActionsControl: after PR created, calls jira.runAutomation("on_pr_opened") non-fatally
- Jira toggle button in ChatHeader
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
def3767 to
625e06e
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 5 total unresolved issues (including 4 from previous reviews).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d8ee5ad. Configure here.
|
Oops. Meant to push this to personal fork. |
ApprovabilityVerdict: Needs human review 2 blocking correctness issues found. Diff is too large for automated approval analysis. A human reviewer should evaluate this PR. You can customize Macroscope's approvability policy. Learn more. |
| import { spawnSync } from "node:child_process"; | ||
| import { fileURLToPath } from "node:url"; | ||
|
|
||
| const bunExecutable = process.env.npm_execpath ?? "bun"; |
There was a problem hiding this comment.
🟡 Medium scripts/cli.mjs:6
When this script is invoked via npm run, process.env.npm_execpath contains npm's CLI script path (e.g., /usr/lib/node_modules/npm/bin/npm-cli.js), not a runtime executable. spawnSync then attempts to use that npm script to execute cli.ts, which fails because npm's CLI cannot directly run TypeScript files. The intent is to run cli.ts with bun, so the npm_execpath check is counterproductive when npm is the package manager. Consider removing the npm_execpath fallback or checking that the value is actually bun.
-const bunExecutable = process.env.npm_execpath ?? "bun";
+const bunExecutable = "bun";Also found in 1 other location(s)
apps/server/scripts/cli.ts:147
The
bunExecutablevariable is assignedprocess.env.npm_execpath ?? process.execPath, but when running the build via npm (wherenpm_execpathpoints to npm's executable), the commandnpm tsdownwill fail because npm doesn't accepttsdownas a direct subcommand. Similarly, the fallbackprocess.execPathis the Node.js binary path, sonode tsdownwould also fail. This logic only works correctly when bun is the package manager.
🤖 Copy this AI Prompt to have your agent fix this:
In file apps/server/scripts/cli.mjs around line 6:
When this script is invoked via `npm run`, `process.env.npm_execpath` contains npm's CLI script path (e.g., `/usr/lib/node_modules/npm/bin/npm-cli.js`), not a runtime executable. `spawnSync` then attempts to use that npm script to execute `cli.ts`, which fails because npm's CLI cannot directly run TypeScript files. The intent is to run `cli.ts` with bun, so the `npm_execpath` check is counterproductive when npm is the package manager. Consider removing the `npm_execpath` fallback or checking that the value is actually bun.
Evidence trail:
apps/server/scripts/cli.mjs line 6 shows `const bunExecutable = process.env.npm_execpath ?? "bun";`. The variable name `bunExecutable` indicates intent to use bun. apps/server/package.json shows `"build": "node scripts/cli.mjs build"` which is invoked via `npm run build`. npm documentation confirms `npm_execpath` is set to the path of npm's executable (https://docs.npmjs.com/cli/v10/using-npm/scripts#environment). npm's CLI cannot execute TypeScript files directly - only a runtime like bun or ts-node can.
Also found in 1 other location(s):
- apps/server/scripts/cli.ts:147 -- The `bunExecutable` variable is assigned `process.env.npm_execpath ?? process.execPath`, but when running the build via npm (where `npm_execpath` points to npm's executable), the command `npm tsdown` will fail because npm doesn't accept `tsdown` as a direct subcommand. Similarly, the fallback `process.execPath` is the Node.js binary path, so `node tsdown` would also fail. This logic only works correctly when bun is the package manager.
| [keybindings, nonTerminalShortcutLabelOptions], | ||
| ); | ||
| const onToggleDiff = useCallback(() => { | ||
| const applyToolsPanelState = useCallback( |
There was a problem hiding this comment.
🟡 Medium components/ChatView.tsx:1474
The onDiffPanelOpen callback is no longer invoked when toggling the Git panel via the header button or keyboard shortcut. The refactored onToggleGit handler uses applyToolsPanelState which updates the Jira store and navigates, but never calls onDiffPanelOpen?.(). This breaks any parent component relying on this callback for coordination when the git panel is toggled.
🤖 Copy this AI Prompt to have your agent fix this:
In file apps/web/src/components/ChatView.tsx around line 1474:
The `onDiffPanelOpen` callback is no longer invoked when toggling the Git panel via the header button or keyboard shortcut. The refactored `onToggleGit` handler uses `applyToolsPanelState` which updates the Jira store and navigates, but never calls `onDiffPanelOpen?.()`. This breaks any parent component relying on this callback for coordination when the git panel is toggled.
Evidence trail:
1. ChatView.tsx lines 1503-1516 (REVIEWED_COMMIT): `onToggleGit` handler does not call `onDiffPanelOpen?.()`
2. ChatView.tsx git_show commit 3157505398a3f689fc63dae02be6109f3de67e87: Shows old `onToggleDiff` was renamed to `onToggleGit` and the `if (!diffOpen) { onDiffPanelOpen?.(); }` block was removed
3. _chat.$environmentId.$threadId.tsx lines 298, 321 (REVIEWED_COMMIT): `onDiffPanelOpen={markDiffOpened}` but `markDiffOpened` is not defined
4. git_grep for `const markDiffOpened` returns no results - confirming it's undefined
5. ChatView.tsx line 3440: `onOpenTurnDiff` still calls `onDiffPanelOpen?.()`, showing the callback is expected to function

Note
Medium Risk
Adds new Jira configuration handling, WebSocket RPC endpoints, and client-side worktree/automation flows that interact with external Jira APIs and git state; failures could impact developer workflows and leak misconfigurations. Also changes server pathing for
secretsDirand build invocation, which could affect runtime environments if assumptions differ.Overview
Adds end-to-end Jira integration: a repo-root
.t3-jira-config.json(git/worktree-aware) loader,JiraConfig/JiraServicelayers, and ADF-to-Markdown conversion for issue descriptions/comments, exposed via new WebSocket RPC methods (jira.getConfigStatus,jira.listActiveTasks,jira.getIssueDetail,jira.runAutomation).Updates the web app to surface Jira in the UI: a Jira toggle in
ChatHeader, a new tools-panel Jira tab (JiraPanelTab/JiraIssueDetailPane) with sorting and state-aware work actions that can create git worktrees/threads seeded with Jira prompts, and hooks to trigger Jira automations when branches are created or PRs are opened.Also tweaks infrastructure: routes server build through a Node shim (
scripts/cli.mjs) for the TypeScript CLI, movessecretsDirtobaseDir/secrets, adds.t3-jira-config.jsonto.gitignore, and adds coverage/tests around the new Jira service and UI behavior.Reviewed by Cursor Bugbot for commit d8ee5ad. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add Jira active tasks right panel with state-aware work actions
JiraSidePanelandJiraPanelTabthat lists active Jira issues, supports sorting by status/key, and shows aJiraIssueDetailPanefor the selected issue.buildJiraWorkActionState) that recommends Start Work, Continue Work, or Start Review based on issue status and matching git branches.JiraConfig,JiraService) with WebSocket RPC endpoints forgetConfigStatus,listActiveTasks,getIssueDetail, andrunAutomation.ChatViewgains anonRunJiraWorkActionhandler that creates worktrees/branches, runs Jira automations, opens a new thread seeded with context-appropriate prompts, and invalidates Jira query caches.ToolsPanelContentthat switches between Git and Jira tabs; theChatHeadergains separate Git and Jira toggle buttons..t3-jira-config.jsonat the git repo root, withadfToMarkdownused to convert ADF issue descriptions to Markdown for display.useJiraToolsStore) shared acrossChatViewand the route, so mismatches in open/tab state could occur if both update simultaneously.📊 Macroscope summarized def3767. 50 files reviewed, 13 issues evaluated, 2 issues filtered, 9 comments posted
🗂️ Filtered Issues
apps/server/scripts/cli.mjs — 0 comments posted, 1 evaluated, 1 filtered
npm_execpathreturns the path to the package manager's CLI script (e.g.,/usr/lib/node_modules/npm/bin/npm-cli.jsfor npm), not the runtime executable. If this script is invoked via npm (npm run ...),bunExecutablewill be set to npm's CLI script path, andspawnSync(bunExecutable, [cliEntrypoint, ...])will fail because npm's CLI script cannot execute a.tsfile directly. The intent appears to be runningcli.tswith bun's TypeScript support, so the fallback to"bun"is correct, but thenpm_execpathcheck defeats this when npm is the invoking package manager. [ Cross-file consolidated ]apps/web/src/components/ChatView.tsx — 0 comments posted, 3 evaluated, 1 filtered
onRunJiraWorkAction, the code callsuseJiraToolsStore.getState().setJiraOpen(true)(line 3285) expecting the Jira panel to appear. However, sinceRightPanelonly renders based onplanSidebarOpen(notjiraOpen), the Jira panel will never be shown after thread creation. The state is updated but there's no corresponding UI response. [ Failed validation ]