Native Runtime: codepilot_schedule_task and related builtin tools not available in any session

Abierto
#634 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
1-2 días
Aptitud para principiantes
48/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
electron, nextjs, typescript
Área
desktop, tooling

Línea de trabajo

Start in src/lib/builtin-tools/index.ts and inspect the notification module and its imports, especially the require('./notification') path and notification.ts. Reproduce the missing tools in a Native Runtime chat, then check why the notification group is not registered. Done means the listed notification tools are available in eligible sessions and the module-loading failure is no longer silent.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

needs-repro P1-runtime-session

Description

In CodePilot's Native Runtime, the scheduled task / notification builtin tools (codepilot_schedule_task, codepilot_list_tasks, codepilot_cancel_task, codepilot_notify, codepilot_hatch_buddy) are not available in any chat session — neither in assistant mode nor in any other conversation.

The model prompt lists the harness extensions, and NotificationMcp (Native Runtime) is shown as a plugin (not executable), while all other CodePilot extensions (e.g. DashboardMcp, SessionSearchMcp, CliTools, MemorySearch) correctly show as executable.

Expected Behavior

Per src/lib/builtin-tools/index.ts, getToolGroups() registers codepilot-notify with condition: 'always', so these tools should be available in every non-heartbeat, non-plan session:

  • codepilot_notify — send notification
  • codepilot_schedule_task — create scheduled task (cron / interval / once)
  • codepilot_list_tasks — list scheduled tasks
  • codepilot_cancel_task — cancel a task
  • codepilot_hatch_buddy — hatch buddy

Actual Behavior

The model's tool list does not include any of the above. The harness extension list shows:

- NotificationMcp (Native Runtime) (native plugin) — Detected in builtin-tools. Not executable...

while other Native Runtime tools correctly show:

- DashboardMcp (Native Runtime) (native plugin) — Detected in builtin-tools. Executable in current Runtime

Steps to Reproduce

  1. Open CodePilot desktop app
  2. Start any chat session (assistant mode or normal)
  3. Ask the model to create a scheduled task, e.g. "帮我创建一个10分钟间隔的心跳任务"
  4. The model cannot call any schedule/notify tool

Root Cause Investigation

From the source code (src/lib/builtin-tools/index.ts):

try {
  const { createNotificationTools, NOTIFICATION_SYSTEM_PROMPT } = require('./notification');
  groups.push({
    name: 'codepilot-notify',
    systemPrompt: NOTIFICATION_SYSTEM_PROMPT,
    condition: 'always',
    tools: createNotificationTools({
      sessionId: options.sessionId,
      workingDirectory: options.workspacePath,
    }),
  });
} catch { /* notification module not available */ }

The catch block is silent. It appears the require('./notification') is failing silently, so the group never gets registered.

Other tools with the same pattern (e.g. ./dashboard, ./session-search) work fine, so the issue is likely specific to the notification module — possibly a missing dependency (e.g. @/lib/notification-manager) that throws during require().

Suggested Fix

  1. Add logging to the catch block so the failure is visible in dev/console:
    catch (err) {
      console.warn('[builtin-tools] Failed to load notification module:', err);
    }
    
  2. Check if @/lib/notification-manager or any import in notification.ts has a missing dependency or circular import that causes silent failure.

Environment

  • CodePilot version: latest (as of 2026-06-12)
  • OS: macOS (Darwin, arm64)
  • Runtime: Native Runtime (CodePilot desktop client)
Lenguaje dominante
TypeScript
Estrellas
6.5k
Forks
697
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

  • Sin Dockerfile ni archivo de Docker Compose
  • Tiene una plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de op7418/CodePilot

Todos los issues de op7418/CodePilot

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.