Skip to content

fix: pass instance root to telegram doctor#257

Merged
0xmrpeter merged 1 commit into
Open-ACP:mainfrom
an1creator:fix/telegram-doctor-data-dir
May 18, 2026
Merged

fix: pass instance root to telegram doctor#257
0xmrpeter merged 1 commit into
Open-ACP:mainfrom
an1creator:fix/telegram-doctor-data-dir

Conversation

@an1creator
Copy link
Copy Markdown
Contributor

Summary

Fixes the Telegram Doctor command by passing the active OpenACP instance root into DoctorEngine, matching the CLI doctor path and preventing options.dataDir from being read from undefined.

Related Issues

None found.

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 🔌 New adapter / plugin
  • 📝 Documentation
  • ♻️ Refactor (no functional change)
  • ⚡ Performance improvement
  • 🧪 Tests
  • 🔧 CI / Build / Config

Changes Made

  • Pass core.instanceContext.root to DoctorEngine from Telegram /doctor, menu callback, and doctor fix callback flows.
  • Thread OpenACPCore through Telegram doctor callback registration.
  • Add Telegram Doctor tests covering initial diagnostics and rerun after applying a pending fix.

Testing

  • Ran pnpm test — all tests pass
  • Tested manually with: Telegram
  • Added new tests for this change
  • No tests needed (explain why)

Commands run:

  • pnpm vitest run src/plugins/telegram/commands/__tests__/doctor.test.ts
  • pnpm vitest run src/plugins/telegram/commands/__tests__/doctor.test.ts src/cli/commands/__tests__/doctor-json.test.ts src/core/doctor/__tests__/telegram-check.test.ts
  • pnpm exec tsc --noEmit
  • pnpm build
  • pnpm test currently fails on existing unrelated test src/core/agents/__tests__/agent-installer.test.ts > falls back to binary when no npx/uvx on Linux because the fixture only defines darwin-aarch64 binary distribution.

Platform Impact

  • Telegram
  • Discord
  • Slack
  • CLI
  • REST API
  • Web UI
  • All / Core

Screenshots / Recordings

Not applicable.

Checklist

  • My code follows the project's TypeScript conventions (ESM, .js extensions)
  • I have updated relevant documentation (if needed)
  • I have added/updated tests (if applicable)
  • My changes don't introduce new warnings or errors
  • I have run pnpm build successfully
  • My changes are backward compatible with existing config and data formats
  • If changing plugin API / PluginContext: I have updated src/cli/plugin-template/

@0xmrpeter
Copy link
Copy Markdown
Contributor

Thanks for the contribution! This is a clean, targeted fix — the root cause is clear, the change is minimal, and the new tests cover both the initial run and the fix-rerun path.

One minor suggestion for future improvements: consider adding vi.resetModules() in beforeEach to avoid potential module-cache flakiness with the dynamic import('../doctor.js') pattern.

Merging this in. Appreciate the work!

@0xmrpeter 0xmrpeter merged commit 8852fb5 into Open-ACP:main May 18, 2026
4 checks passed
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.

2 participants