Skip to content

Conversation

@evereq
Copy link
Member

@evereq evereq commented Dec 18, 2025

PR

Please note: we will close your PR without comment if you do not check the boxes above and provide ALL requested information.



Summary by cubic

Stabilizes builds across platforms (including Windows) and upgrades CI to Node 22, while improving the desktop timer with better auth handling, task syncing, and clearer tray/always‑on UI.

  • New Features

    • Tray icon turns gray when the timer is idle.
    • Persist selected task from the task table and update task status while tracking.
    • Always‑on widget shows an offline indicator and uses a slimmer layout.
  • Bug Fixes

    • Fix Windows builds and native module compilation in MCP/API Docker images by adding required build tools and correct rebuild steps.
    • Handle offline/unauthenticated states on agent startup; queue processing no longer errors on 401.
    • CI: upgrade to Node 22.21.1 and npm 10.9.4; install node-gyp, ts-node, and nx globally; add a dedicated Windows workflow.
  • Dependencies

    • Add ts-node and cross-env to multiple packages; switch scripts to ts-node/cross-env.
    • Bump @modelcontextprotocol/sdk to 1.24.0.
    • Minor cspell dictionary updates.

Written for commit baa0aee. Summary will update automatically on new commits.

evereq and others added 23 commits December 10, 2025 11:28
[FIX] Fix Gauzy MCP/MCP OAuth Server build related to missing critical dependencies to compile native nodejs modules
* fix: agent handle unauthorize in starting up

* fix: desktop timer tray icon gray when timer not started

* fix: implement ai suggestions

* fix: implement ai suggestions

* Update packages/desktop-ui-lib/src/lib/time-tracker/task-table/table/task-table.component.ts

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>

---------

Co-authored-by: Ruslan Konviser <[email protected]>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
* Update desktop-timer-app-stage.yml

* Update desktop-timer-app-stage.yml (#9262)

* Update desktop-timer-app-stage.yml

* Update .github/workflows/desktop-timer-app-stage.yml

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* Update desktop-timer-app-stage.yml

* chore: temporary new build action for Windows for testing

* chore: win builds

* chore: win

* chore: win

* fix: Add critical build dependencies to compile nodejs modules to the Dockerfile

* Fix/agent queue process error handle (#9266)

* fix: agent handle unauthorize in starting up

* fix: desktop timer tray icon gray when timer not started

* fix: implement ai suggestions

* fix: implement ai suggestions

* Update packages/desktop-ui-lib/src/lib/time-tracker/task-table/table/task-table.component.ts

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>

---------

Co-authored-by: Ruslan Konviser <[email protected]>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>

---------

Co-authored-by: Rahul R. <[email protected]>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: rolandm99 <[email protected]>
Co-authored-by: syns <[email protected]>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
#9268)

* fix: use the correct rebuild patterns for all native packages

* Update .deploy/mcp/Dockerfile

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>

* fix: add review suggestions

---------

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
)

* chore(deps): bump @modelcontextprotocol/sdk from 1.15.1 to 1.24.0

Bumps [@modelcontextprotocol/sdk](https://github.com/modelcontextprotocol/typescript-sdk) from 1.15.1 to 1.24.0.
- [Release notes](https://github.com/modelcontextprotocol/typescript-sdk/releases)
- [Commits](modelcontextprotocol/typescript-sdk@1.15.1...1.24.0)

---
updated-dependencies:
- dependency-name: "@modelcontextprotocol/sdk"
  dependency-version: 1.24.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* fix: add commands for native nodejs modules

* fix: add typos spelling

* fix: add typos spelling

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: rolandm99 <[email protected]>
* [FIX] Use the correct rebuild process patterns for all native packages (#9268)

* fix: use the correct rebuild patterns for all native packages

* Update .deploy/mcp/Dockerfile

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>

* fix: add review suggestions

---------

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>

* chore(deps): bump @modelcontextprotocol/sdk from 1.15.1 to 1.24.0 (#9250)

* chore(deps): bump @modelcontextprotocol/sdk from 1.15.1 to 1.24.0

Bumps [@modelcontextprotocol/sdk](https://github.com/modelcontextprotocol/typescript-sdk) from 1.15.1 to 1.24.0.
- [Release notes](https://github.com/modelcontextprotocol/typescript-sdk/releases)
- [Commits](modelcontextprotocol/typescript-sdk@1.15.1...1.24.0)

---
updated-dependencies:
- dependency-name: "@modelcontextprotocol/sdk"
  dependency-version: 1.24.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* fix: add commands for native nodejs modules

* fix: add typos spelling

* fix: add typos spelling

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: rolandm99 <[email protected]>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Roland MN <[email protected]>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 18, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch stage

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Comment on lines +13 to +173
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [warp-windows-latest-x64-16x]

steps:
- name: Check out Git repository
uses: actions/checkout@v4

- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v4
with:
node-version: 22.21.1
cache: 'yarn'

- name: Install Visual Studio 2022 Build Tools (VCTools)
shell: powershell
run: |
choco install -y visualstudio2022buildtools --execution-timeout=21600 --package-parameters "--add Microsoft.VisualStudio.Workload.VCTools --includeRecommended --includeOptional --passive --norestart"
# ✅ Help node-gyp pick VS 2022 explicitly
- name: Configure node-gyp to use VS 2022
shell: powershell
run: |
"GYP_MSVS_VERSION=2022" | Out-File -FilePath $env:GITHUB_ENV -Append
"npm_config_msvs_version=2022" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Fix node-gyp and Python
run: python3 -m pip install packaging setuptools

- name: Setup MSVC (VS 2022 dev env)
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64

- name: Install latest version of NPM
run: 'npm install -g [email protected]'

- name: Install globally node-gyp, ts-node and nx packages
run: 'npm install --quiet -g [email protected] [email protected] [email protected]'

- name: Configure npm python for node-gyp
shell: powershell
run: |
$py = (Get-Command python.exe).Source
Write-Host "python is: $py"
"npm_config_python=$py" | Out-File -FilePath $env:GITHUB_ENV -Append
"PYTHON=$py" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Show tool versions
shell: powershell
run: |
node -v
npm -v
python --version
python -c "import sys; print(sys.executable)"
- name: Install Yarn dependencies
run: 'yarn install --network-timeout 1000000 --frozen-lockfile --ignore-scripts'

- name: Run Postinstall Manually
run: 'yarn postinstall.manual'

- name: Bump version desktop timer app
uses: actions/github-script@v7
with:
script: |
const script = require('./.scripts/bump-version-electron.js')
console.log(script.desktopTimer(false))
env:
PROJECT_REPO: 'https://github.com/ever-co/ever-gauzy.git'
DESKTOP_TIMER_APP_NAME: 'ever-gauzy-desktop-timer'
COMPANY_SITE_LINK: 'https://gauzy.co'
DESKTOP_TIMER_APP_DESCRIPTION: 'Ever Gauzy Desktop Timer'
DESKTOP_TIMER_APP_ID: 'com.ever.gauzydesktoptimer'

- name: Print environment variables and their sizes
shell: powershell
run: |
foreach ($envVar in [System.Environment]::GetEnvironmentVariables().Keys) {
$value = [System.Environment]::GetEnvironmentVariable($envVar)
if ($null -ne $value) {
$length = $value.Length
Write-Output "${envVar}: ${length}"
}
}
- name: Print PATH var value
shell: powershell
run: |
$path = [System.Environment]::GetEnvironmentVariable('PATH')
Write-Output "PATH environment variable is:"
Write-Output $path
- name: Add Yarn/Node/npm-global/node_modules to GITHUB_PATH
shell: powershell
run: |
# Get yarn and node directories
$yarnPath = (Get-Command yarn).Source | Split-Path -Parent
$nodePath = (Get-Command node).Source | Split-Path -Parent
# Get npm global prefix (where global packages are installed)
$npmGlobalBin = npm config get prefix
# Get the workspace's node_modules/.bin for local binaries (cross-env, ts-node, etc.)
$localBin = Join-Path $PWD "node_modules\.bin"
# Add all paths to GITHUB_PATH for subprocess inheritance
echo $localBin >> $env:GITHUB_PATH
echo $npmGlobalBin >> $env:GITHUB_PATH
echo $yarnPath >> $env:GITHUB_PATH
if ($nodePath -ne $yarnPath) {
echo $nodePath >> $env:GITHUB_PATH
}
Write-Host "Added to GITHUB_PATH:"
Write-Host " Local bin: $localBin"
Write-Host " npm global: $npmGlobalBin"
Write-Host " Yarn path: $yarnPath"
Write-Host " Node path: $nodePath"
# Verify the binaries exist
Write-Host ""
Write-Host "Checking local binaries:"
if (Test-Path "$localBin\cross-env.cmd") { Write-Host " cross-env: found" } else { Write-Host " cross-env: NOT FOUND" }
if (Test-Path "$localBin\ts-node.cmd") { Write-Host " ts-node: found" } else { Write-Host " ts-node: NOT FOUND" }
if (Test-Path "$localBin\nx.cmd") { Write-Host " nx: found" } else { Write-Host " nx: NOT FOUND" }
- name: Build Desktop Timer App
shell: powershell
run: |
# Print PATH for debugging
Write-Host "=== Current PATH ==="
$env:PATH -split ';' | ForEach-Object { Write-Host " $_" }
Write-Host ""
Write-Host "=== Command locations ==="
Write-Host "Node: $((Get-Command node -ErrorAction SilentlyContinue).Source)"
Write-Host "Yarn: $((Get-Command yarn -ErrorAction SilentlyContinue).Source)"
Write-Host "npx: $((Get-Command npx -ErrorAction SilentlyContinue).Source)"
Write-Host "ts-node: $((Get-Command ts-node -ErrorAction SilentlyContinue).Source)"
Write-Host "cross-env: $((Get-Command cross-env -ErrorAction SilentlyContinue).Source)"
Write-Host "nx: $((Get-Command nx -ErrorAction SilentlyContinue).Source)"
Write-Host ""
Write-Host "=== Starting build ==="
# Run the build
yarn build:desktop-timer:windows:release:gh
env:
USE_HARD_LINKS: false
GH_TOKEN: ${{ secrets.GH_TOKEN }}
EP_GH_IGNORE_TIME: true
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
SENTRY_TRACES_SAMPLE_RATE: '${{ secrets.SENTRY_TRACES_SAMPLE_RATE }}'
SENTRY_PROFILE_SAMPLE_RATE: '${{ secrets.SENTRY_PROFILE_SAMPLE_RATE }}'
SENTRY_HTTP_TRACING_ENABLED: '${{ secrets.SENTRY_HTTP_TRACING_ENABLED }}'
SENTRY_POSTGRES_TRACKING_ENABLED: '${{ secrets.SENTRY_POSTGRES_TRACKING_ENABLED }}'
SENTRY_PROFILING_ENABLED: '${{ secrets.SENTRY_PROFILING_ENABLED }}'
DO_KEY_ID: ${{ secrets.DO_KEY_ID }}
DO_SECRET_KEY: ${{ secrets.DO_SECRET_KEY }}
NX_NO_CLOUD: true

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 26 days ago

To fix the problem, the explicit permissions: block should be added at either the root of the workflow or at the job level to restrict the permissions of the GITHUB_TOKEN to the minimum required. Since nothing in the shown steps appears to require write access to the repository (most actions use local context or secrets for publishing), setting permissions: contents: read is a safe minimal configuration. If, in the future, steps require write permissions for issues, pull requests, or packages, those can be added incrementally. The fix should be done by inserting the line permissions:\n contents: read after the workflow name: (line 1), before on: (line 3), so that the permission applies to the entire workflow.


Suggested changeset 1
.github/workflows/windows.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml
--- a/.github/workflows/windows.yml
+++ b/.github/workflows/windows.yml
@@ -1,4 +1,6 @@
 name: Desktop Build Windows Fixing
+permissions:
+  contents: read
 
 on:
   push:
EOF
@@ -1,4 +1,6 @@
name: Desktop Build Windows Fixing
permissions:
contents: read

on:
push:
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
@evereq evereq merged commit 878b84e into stage-apps Dec 18, 2025
17 of 20 checks passed
@cla-assistant
Copy link

cla-assistant bot commented Dec 18, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
3 out of 4 committers have signed the CLA.

✅ evereq
✅ syns2191
✅ RolandM99
❌ dependabot[bot]
You have signed the CLA already but the status is still pending? Let us recheck it.

@cla-assistant
Copy link

cla-assistant bot commented Dec 18, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
3 out of 4 committers have signed the CLA.

✅ evereq
✅ RolandM99
✅ syns2191
❌ dependabot[bot]
You have signed the CLA already but the status is still pending? Let us recheck it.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 18, 2025

Greptile Summary

This PR merges changes from the develop branch focused on Windows build improvements and desktop timer app enhancements. The changes update Node.js to v22.21.1, add build tooling (ts-node, cross-env), and implement task/project tracking for the desktop timer agent.

Major Changes:

  • Windows Build Infrastructure: New Windows workflow with Visual Studio 2022, enhanced node-gyp configuration, and improved PATH management for building native modules
  • Node.js & Tooling Updates: Upgraded to Node.js v22.21.1, NPM v10.9.4, added ts-node and nx as global packages across all workflows
  • Docker Build Enhancements: Added build dependencies (node-gyp, ts-node) and switched from direct npm rebuild to manual postinstall process
  • Task/Project Tracking: Desktop timer agent now tracks selected tasks/projects and automatically updates task status to IN_PROGRESS when timer starts
  • Enhanced Authentication: Added server-side authentication validation with online status check and improved offline handling
  • Error Handling: Improved error handling in activity push workers with nested try-catch blocks to prevent queue failures

Issues Found:

  • updateProject function accepts but doesn't use organizationId parameter (violates custom rule ee186c2f-1a72-402b-901d-06d0cf08a36e)
  • IPC handler uses nullish coalescing with string "null" instead of actual null values
  • Failed authentication check doesn't display auth window for re-authentication
  • Multi-tenant task status caching issue where statusProgress isn't keyed by tenant/organization
  • Automatic task status updates to IN_PROGRESS may override legitimate states without user control

Confidence Score: 3/5

  • This PR has several logical issues that need addressing before merge, particularly around null handling and multi-tenant data consistency
  • The PR includes extensive build infrastructure improvements that are well-implemented, but the task tracking feature has 4 logical bugs: unused parameters, incorrect null handling, incomplete error flow, and potential multi-tenant data corruption. The build and dependency changes are safe, but the agent code needs fixes
  • Pay close attention to apps/agent/src/main/util.ts, apps/agent/src/main/init/ipcMain.ts, apps/agent/src/main/auth.ts, and apps/agent/src/main/api.ts for the logic issues identified

Important Files Changed

Filename Overview
apps/agent/src/main/util.ts Added project configuration management functions but updateProject doesn't use the organizationId parameter it accepts
apps/agent/src/main/init/ipcMain.ts Added TASK_SELECTED IPC handler but incorrectly uses nullish coalescing with string "null" instead of actual null
apps/agent/src/main/auth.ts Enhanced authentication check with online status and server validation, but failed auth check doesn't display auth window for re-authentication
apps/agent/src/main/api.ts Added task status management and project config integration, but statusProgress caching may cause issues in multi-tenant scenarios
apps/agent/src/main/workers/push-activities.ts Improved error handling with nested try-catch blocks and added automatic task status updates to IN_PROGRESS when timer starts
.github/workflows/windows.yml New Windows-specific build workflow with Visual Studio 2022 setup, node-gyp configuration, and PATH management for building desktop apps
.github/workflows/desktop-timer-app-stage.yml Updated Node.js to v22.21.1, NPM to v10.9.4, added ts-node and nx global packages, improved Windows build tooling with VS 2022
packages/desktop-ui-lib/src/lib/time-tracker/task-table/table/task-table.component.ts Added IPC event handler to notify Electron main process when task is selected from table for project/task tracking

Sequence Diagram

sequenceDiagram
    participant UI as Desktop UI (Task Table)
    participant IPC as IPC Main Handler
    participant Store as LocalStore
    participant Timer as Timer/Worker
    participant API as API Service
    participant Server as Gauzy Server

    Note over UI,Server: Task Selection Flow
    UI->>IPC: TASK_SELECTED event (taskId, projectId, organizationId)
    IPC->>Store: updateProject(projectId, taskId, organizationId)
    Note over Store: Stores project config locally

    Note over UI,Server: Timer Start Flow
    Timer->>API: getTimeToggleParams()
    API->>Store: getProjectConfig()
    Store-->>API: projectId, taskId, organizationContactId
    API->>Server: POST /api/time-log/start (with project/task)
    Server-->>API: Timer started

    Note over UI,Server: Activity Sync & Task Status Update
    Timer->>Timer: syncTimer(job)
    Timer->>Timer: updateTaskStatus()
    Timer->>API: getTask(taskId)
    API->>Server: GET /api/tasks/:taskId
    Server-->>API: Task details
    
    alt Task status is not IN_PROGRESS
        Timer->>API: getTasksStatuses()
        API->>Server: GET /api/task-statuses
        Server-->>API: Status list
        Note over API: Cache statusProgress
        Timer->>API: updateTaskStatus(taskId)
        API->>Server: PUT /api/tasks/:taskId (status=IN_PROGRESS)
        Server-->>API: Updated task
    end

    Note over UI,Server: Activity Push with Project Context
    Timer->>API: createTimeSlotPayload()
    API->>Store: getProjectConfig()
    Store-->>API: projectId, taskId, organizationContactId
    API->>Server: POST /api/time-slot (with project/task context)
    Server-->>API: TimeSlot created

    Note over UI,Server: Authentication Check
    Timer->>API: checkUserAuthentication()
    API->>Server: GET /api/auth/authenticated
    alt Online & Authenticated
        Server-->>API: Authenticated
        API-->>Timer: Continue operations
    else Offline
        Note over Timer: Skip server check, continue
    else Not Authenticated
        API-->>Timer: Show auth window
    end
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

39 files reviewed, 5 comments

Edit Code Review Agent Settings | Greptile

Comment on lines +133 to +141
export function updateProject(project: {
projectId: string;
taskId: string;
organizationId: string;
}) {
LocalStore.updateConfigProject({
projectId: project.projectId,
taskId: project.taskId
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: organizationId parameter is accepted but never used in the function body

Suggested change
export function updateProject(project: {
projectId: string;
taskId: string;
organizationId: string;
}) {
LocalStore.updateConfigProject({
projectId: project.projectId,
taskId: project.taskId
});
export function updateProject(project: {
projectId: string;
taskId: string;
organizationId: string;
}) {
LocalStore.updateConfigProject({
projectId: project.projectId,
taskId: project.taskId,
organizationContactId: project.organizationContactId
});
}

Context Used: Context from dashboard - Remove unused props from component interfaces in TypeScript, or add comments explaining their purpos... (source)

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/agent/src/main/util.ts
Line: 133:141

Comment:
**logic:** `organizationId` parameter is accepted but never used in the function body

```suggestion
export function updateProject(project: {
	projectId: string;
	taskId: string;
	organizationId: string;
}) {
	LocalStore.updateConfigProject({
		projectId: project.projectId,
		taskId: project.taskId,
		organizationContactId: project.organizationContactId
	});
}
```

**Context Used:** Context from `dashboard` - Remove unused props from component interfaces in TypeScript, or add comments explaining their purpos... ([source](https://app.greptile.com/review/custom-context?memory=ee186c2f-1a72-402b-901d-06d0cf08a36e))

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines +324 to +330
ipcMain.handle('TASK_SELECTED', (_, data: { taskId: string; organizationId: string; projectId: string }) => {
updateProject({
taskId: data.taskId ?? null,
organizationId: data.organizationId ?? null,
projectId: data.projectId ?? null
});
return true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Passing null as string will store the string "null" instead of actual null value. Use JavaScript null directly

Suggested change
ipcMain.handle('TASK_SELECTED', (_, data: { taskId: string; organizationId: string; projectId: string }) => {
updateProject({
taskId: data.taskId ?? null,
organizationId: data.organizationId ?? null,
projectId: data.projectId ?? null
});
return true;
ipcMain.handle('TASK_SELECTED', (_, data: { taskId: string; organizationId: string; projectId: string }) => {
updateProject({
taskId: data.taskId || null,
organizationId: data.organizationId || null,
projectId: data.projectId || null
});
return true;
});
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/agent/src/main/init/ipcMain.ts
Line: 324:330

Comment:
**logic:** Passing `null` as string will store the string "null" instead of actual null value. Use JavaScript null directly

```suggestion
	ipcMain.handle('TASK_SELECTED', (_, data: { taskId: string; organizationId: string; projectId: string }) => {
		updateProject({
			taskId: data.taskId || null,
			organizationId: data.organizationId || null,
			projectId: data.projectId || null
		});
		return true;
	});
```

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines +40 to +43
const isAuthenticated = await apiService.isAuthenticated();
if (!isAuthenticated) {
return false;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: If authentication check fails, the function returns false but doesn't show the auth window to the user, leaving them in an unauthenticated state with no way to re-authenticate. Should the auth window be displayed when the authentication check fails, similar to when no token exists?

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/agent/src/main/auth.ts
Line: 40:43

Comment:
**logic:** If authentication check fails, the function returns false but doesn't show the auth window to the user, leaving them in an unauthenticated state with no way to re-authenticate. Should the auth window be displayed when the authentication check fails, similar to when no token exists?

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines +404 to +416
async getTasksStatuses({
tenantId,
organizationId
}: { tenantId: string, organizationId: string }): Promise<void> {
if (this.statusProgress) {
return;
}
const path = `/api/task-statuses`;
const taskStatuses: Partial<IPagination<ITaskStatus>> = await this.get(path, {
tenantId,
organizationId
});
this.statusProgress = taskStatuses.items?.find((i) => i.value === TaskStatusEnum.IN_PROGRESS);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Using a cached instance field (this.statusProgress) for task statuses across different tenants/organizations could cause data inconsistency in multi-tenant scenarios. Should the statusProgress cache be keyed by tenantId/organizationId to handle multi-tenant scenarios correctly?

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/agent/src/main/api.ts
Line: 404:416

Comment:
**logic:** Using a cached instance field (`this.statusProgress`) for task statuses across different tenants/organizations could cause data inconsistency in multi-tenant scenarios. Should the statusProgress cache be keyed by tenantId/organizationId to handle multi-tenant scenarios correctly?

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines 282 to +306
);
}

async updateTaskStatus() {
try {
const authConfig = getAuthConfig();
const projectConfig = getProjectConfig();
if (!projectConfig?.taskId) {
return;
}
const taskStatus = await this.apiService.getTask(projectConfig.taskId);
if (taskStatus.status === TaskStatusEnum.IN_PROGRESS) {
return;
}
return this.apiService.updateTaskStatus(projectConfig.taskId, {
tenantId: authConfig?.user?.employee?.tenantId,
organizationId: authConfig?.user?.employee?.organizationId,
status: TaskStatusEnum.IN_PROGRESS,
title: taskStatus.title
});
} catch (error) {
console.error('Failed update task status', error);
}

}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Consider making automatic task status update to IN_PROGRESS configurable, as it might override legitimate task states without user consent

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/agent/src/main/workers/push-activities.ts
Line: 282:306

Comment:
**style:** Consider making automatic task status update to IN_PROGRESS configurable, as it might override legitimate task states without user consent

<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>

How can I resolve this? If you propose a fix, please make it concise.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 40 files

Prompt for AI agents (all 2 issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="packages/desktop-ui-lib/src/lib/always-on/always-on.component.scss">

<violation number="1" location="packages/desktop-ui-lib/src/lib/always-on/always-on.component.scss:149">
P1: Missing `position: relative` on parent container. The `.current-session` and `.today-time` elements have `position: absolute` but their parent `.time-display` lacks `position: relative`, causing them to position relative to an unintended ancestor instead of their container.</violation>
</file>

<file name="apps/agent/src/main/api.ts">

<violation number="1" location="apps/agent/src/main/api.ts:408">
P1: The `statusProgress` cache doesn&#39;t account for different `tenantId`/`organizationId` combinations. Since `ApiService` is a singleton, switching organizations will reuse the cached status from a previous organization. Consider keying the cache by `tenantId` and `organizationId`, or invalidating the cache when these values change.</violation>
</file>

Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR

font-size: 16px;
font-weight: bold;
line-height: 1.2;
position: absolute;
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: Missing position: relative on parent container. The .current-session and .today-time elements have position: absolute but their parent .time-display lacks position: relative, causing them to position relative to an unintended ancestor instead of their container.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/desktop-ui-lib/src/lib/always-on/always-on.component.scss, line 149:

<comment>Missing `position: relative` on parent container. The `.current-session` and `.today-time` elements have `position: absolute` but their parent `.time-display` lacks `position: relative`, causing them to position relative to an unintended ancestor instead of their container.</comment>

<file context>
@@ -143,15 +143,20 @@ button {
+		font-size: 16px;
 		font-weight: bold;
 		line-height: 1.2;
+		position: absolute;
+		top: 7px;
 	}
</file context>
Fix with Cubic

tenantId,
organizationId
}: { tenantId: string, organizationId: string }): Promise<void> {
if (this.statusProgress) {
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: The statusProgress cache doesn't account for different tenantId/organizationId combinations. Since ApiService is a singleton, switching organizations will reuse the cached status from a previous organization. Consider keying the cache by tenantId and organizationId, or invalidating the cache when these values change.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/agent/src/main/api.ts, line 408:

<comment>The `statusProgress` cache doesn&#39;t account for different `tenantId`/`organizationId` combinations. Since `ApiService` is a singleton, switching organizations will reuse the cached status from a previous organization. Consider keying the cache by `tenantId` and `organizationId`, or invalidating the cache when these values change.</comment>

<file context>
@@ -359,6 +368,54 @@ export class ApiService {
+		tenantId,
+		organizationId
+	}: { tenantId: string, organizationId: string }): Promise&lt;void&gt; {
+		if (this.statusProgress) {
+			return;
+		}
</file context>
Fix with Cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants