Commit Graph
13 Commits
Author SHA1 Message Date
Tam Nhu Tran fae8716900 fix(cursor): fallback when requested model is unavailable
- resolve request model against current available catalog

- choose safe default when configured default id is not present

- add tests and docs for daemon request-model fallback behavior
2026-02-17 20:53:03 +07:00
Tam Nhu Tran 4798741a99 fix(cursor): resolve review feedback and harden edge cases 2026-02-17 16:33:21 +07:00
Tam Nhu Tran c639cefa7b feat(cursor): harden daemon integration and model discovery 2026-02-17 04:09:06 +07:00
Tam Nhu Tran 7b73658f87 feat(cursor): sync model mapping across config and raw settings
- add cursor model fields to unified config defaults and YAML comments

- expand Cursor model catalog/defaults and return configured current model

- keep cursor.settings.json env model fields in sync with config updates

- align unit tests for new model defaults and route merge behavior

Refs #555
2026-02-14 16:57:04 +07:00
Tam Nhu Tran be9d7cf73e feat(cursor): complete daemon wiring and add dedicated dashboard page 2026-02-14 06:22:28 +07:00
Tam Nhu Tran 760a5c3ca4 fix(cursor): harden stopDaemon PID validation, tighten regex, add lifecycle test
- Validate PID belongs to cursor daemon via /proc before signaling
- Tighten detectProvider regex to avoid over-matching o-prefixed models
- Add integration test for daemon start→health→stop lifecycle
- Add void cast on discarded handleHelp() return value
- Update model catalog date comment
2026-02-12 08:28:32 +07:00
Tam Nhu Tran cda037e7e5 fix(cursor): clean up PID file on startDaemon failure and improve daemon robustness
- Add removePidFile() in safeResolve on failure to prevent stale PIDs
- Only send SIGKILL in stopDaemon if SIGTERM wait loop exhausted
- Check isDaemonRunning before model fetch to avoid 5s timeout
- Add port validation unit tests for startDaemon
2026-02-12 08:11:41 +07:00
Tam Nhu Tran ce1915366d fix(cursor): use stdio ignore, sequential polling, move CursorConfig to types
- Change spawn stdio from piped to 'ignore' preventing buffer deadlock
- Replace setInterval with sequential setTimeout polling
- Fix TOCTOU in SIGKILL escalation (send directly without probing)
- Move CursorConfig interface to types.ts
- Change detectProvider default from 'openai' to 'unknown'
- Remove redundant removePidFile() when PID is null
2026-02-12 07:51:22 +07:00
Tam Nhu Tran 94789676b9 fix(cursor): use process.execPath and add safeResolve to model fetcher
- Replace 'node' with process.execPath for cross-platform reliability
- Add safeResolve guard in fetchModelsFromDaemon matching startDaemon pattern
2026-02-12 07:37:20 +07:00
Tam Nhu Tran 36f0308a72 fix(cursor): add response body handling and size limit
- Drain health check response body with res.resume()
- Add 1MB body size limit in fetchModelsFromDaemon
2026-02-12 07:24:10 +07:00
Tam Nhu Tran afb5e746b3 fix(cursor): address remaining PR #527 review feedback
- Add SIGKILL escalation in stopDaemon after SIGTERM timeout
- Document router difference between cursor/copilot help behavior
- Fix detectProvider to handle o1/o4 models via regex pattern
- Add fetchModelsFromDaemon fallback test for unreachable daemon
- Update CLAUDE.md help table with cursor command entry
2026-02-12 04:14:28 +07:00
Tam Nhu Tran 9f0ea25448 fix(cursor): address PR #527 review feedback
- Wire cursor command into main router (ccs.ts) following copilot pattern
- Centralize default port (4242) and model (gpt-4.1) as constants
- Remove duplicate types already in cursor-protobuf-schema from dev
- Handle daemon exit code 0 before health check succeeds
- Export PID helpers and model utils for testability
- Add unit tests for cursor-daemon (PID file ops, isDaemonRunning)
- Add unit tests for cursor-models (detectProvider, formatModelName, defaults)
2026-02-12 04:03:01 +07:00
Tam Nhu Tran aaa31c6427 feat(cursor): add daemon lifecycle, models catalog, and CLI commands
Implements #520 - Cursor IDE daemon, models catalog, module index, and CLI.

Files created:
- src/cursor/cursor-daemon.ts (~230 LOC) - Lifecycle management (start/stop/status)
- src/cursor/cursor-models.ts (~145 LOC) - Model catalog with Anthropic/OpenAI/Google/Cursor models
- src/cursor/index.ts (~30 LOC) - Module barrel exports
- src/commands/cursor-command.ts (~230 LOC) - CLI commands (auth/status/models/start/stop)

Key features:
- Daemon health checks via HTTP /health endpoint
- PID file management in ~/.ccs/cursor/daemon.pid
- Model catalog with fetchModelsFromDaemon() and fallback defaults
- CLI subcommand routing following copilot-command.ts pattern
- ASCII-only output ([OK], [X], [i] markers)

Temporary defaults for config (port: 4242, model: gpt-4.1) until #521 adds
cursor to unified config schema.

Note: Actual daemon server implementation (CursorExecutor integration) deferred
to #522 - this creates the lifecycle structure only.
2026-02-11 18:06:46 +07:00