This document is the operating manual for coding agents working in this repository.
Vibe Remote is a middleware layer that connects AI agent backends to IM platforms such as Slack, Discord, Telegram, Feishu/Lark, and WeChat.
Current product shape:
- V2 config-driven service with a Web UI setup wizard and settings pages
- multi-platform message transport with shared core orchestration
- multi-backend agent routing across OpenCode, Claude Code, and Codex
- Docker-based unified regression container for real cross-platform verification
Default mindset:
- treat the system as multi-platform, multi-backend first
- prefer root-cause fixes over narrow patches
- preserve user-visible behavior unless the task explicitly changes product behavior
- make the next agent/platform inherit correct behavior automatically
- If a bug appears on one platform, check whether the same logic exists for the others before patching a platform adapter.
- If a behavior should be shared by multiple backends, prefer the shared core or backend abstraction over a single backend implementation.
- Keep transport/platform details out of core business logic whenever possible.
Decision checklist before writing code:
- Scope: is this platform-specific/backend-specific, or common?
- Abstraction: can the shared base or core layer own this behavior?
- Call path: is the code called from controller/handlers/common flow?
- Future-proofing: would a new platform/backend inherit the correct behavior automatically?
main.py- entry point wiringconfig.V2Configintocore/controller.pycore/controller.py- orchestration and dependency wiringcore/handlers/- platform/backend-agnostic business workflowscore/message_dispatcher.py- outbound message routing and reply enhancement flowcore/reply_enhancer.py- file-link and quick-reply prompt injection helpersmodules/im/- IM platform adapters (slack.py,discord.py,telegram.py,feishu.py,wechat.py) plus shared base classesmodules/agents/- agent backend adapters (opencode/,codex/, Claude-related modules) plus shared abstractionsmodules/im/formatters/- platform-specific formatting built on shared formatter conceptsconfig/- V2 config, settings, sessions, paths, and compatibility conversionui/- React + Vite + TypeScript Web UIscripts/- operational helpers, including regression testing workflowstests/- pytest-style unit/integration/regression coverage
- logs:
~/.vibe_remote/logs/vibe_remote.log - persisted state:
~/.vibe_remote/state/ - default agent working directory:
_tmp/ - generated regression data:
_tmp/three-regression/
Common commands:
- install:
uv tool install vibe - run:
vibe - inspect:
vibe status - stop:
vibe stop
Use local vibe for:
- local packaging checks
- local CLI behavior checks
- editable-install UI preview when explicitly needed
Hard rule:
- Never restart the local
vibeservice for routine verification. - The local
vibeprocess may be the coding agent runtime itself; restarting it can interrupt the session. - Unless the user explicitly asks otherwise, use the Docker regression environment for user-facing verification.
When the user says 回归测试, treat it as:
- update the latest code into the existing Docker-based regression environment
- let the user verify behavior on Slack, Discord, Feishu/Lark, and WeChat
- preserve previously accumulated regression config/state unless the user explicitly asks for a reset
The regression environment runs a single unified container with all four IM platforms enabled simultaneously.
Standard path:
- default command:
./scripts/run_three_regression.sh
Rules:
- do not use
--reset-configor--reset-allunless the user explicitly requests reset behavior - do not use
--no-buildwhen code changes must take effect; it is only for restarting with the existing image - after running the script, verify the service is healthy before handing back to the user
- prefer Docker regression over local
vibewhenever validating cross-platform behavior, setup wizard behavior, or user-facing IM flows
Persistent configuration is centered on config/v2_config.py and the Web UI.
High-level V2 config areas:
- platform config: Slack / Discord / Telegram / Feishu / WeChat credentials and switches
- runtime config: default cwd, log level, and related runtime behavior
- agent config: default backend plus per-backend enablement and CLI paths
- UI config: setup host/port and Web UI behavior
Agent routing model:
- global default:
agents.default_backend - backend availability and CLI path:
agents.<backend>.enabledandagents.<backend>.cli_path - per-channel overrides: configured via the Web UI Agent Settings / channel settings
Source-of-truth rule:
- when changing persistent product behavior, align with V2 config and current Web UI flows rather than legacy assumptions
- when starting a new feature or bug fix yourself, branch from the latest
master - if the user already put you on an existing branch/worktree, continue there unless asked to move
- keep commits small and focused; avoid mixing unrelated changes
- if the task is complex or ambiguous, create a short plan before large changes
- capture background, goal, solution, and todo items in
docs/plans/ - implementations should follow the plan and update it when scope changes materially
- if requirements are unclear, ask early before committing to a large direction
- update user documentation alongside user-visible features or changed workflows
- store project-specific plans, investigations, and summaries under
docs/ - do not put ad-hoc project documentation in the repo root
- use git worktree for long-running, parallel, or workspace-blocking efforts
- if detailed worktree workflow is needed, load the dedicated worktree skill
- before opening a PR, run the reviewer subagent and fix significant issues first
- PR descriptions must name the changed capability and list the affected scenario IDs when a scenario catalog exists
- PR descriptions must state which evidence layers were updated: unit, contract, scenario, and residual manual checks
- after opening a PR, use the
background-watch-hookskill to keep a review-fix loop running until Codex review passes - by default, create the review watch immediately after the PR is opened; do not wait for the user to remind you unless they explicitly say not to keep a watch
- run the smallest relevant validation first, then broader checks as needed
- before
git push, runruff checkon changed Python files at minimum - fix lint errors before pushing; CI runs
pre-commit run --all-fileswith Ruff
- default to English for comments, docs, logs, and user-facing copy
- use non-English text only when required for localization/i18n
- backend user-facing strings must go through
vibe/i18n/ - frontend user-facing strings must go through
ui/src/i18n/en.jsonandui/src/i18n/zh.json - never hardcode user-visible display text in handlers, platform adapters, or React components
- follow PEP 8 and 4-space indentation
- use
snake_casefor functions andPascalCasefor classes/dataclasses - add type hints for public functions where practical
- keep modules cohesive
- add new business logic under
core/handlers/when it is platform-agnostic - add new IM integrations under
modules/im/and new agent backends undermodules/agents/ - no repo-wide formatter is enforced; keep diffs focused if you use Black/Ruff
- source lives in
ui/ - build command:
npm run buildfromui/ - built assets land in
ui/dist/and are served byvibe/ui_server.py
Important packaging caveat:
- the installed
vibecommand uses packaged UI assets, not rawui/dist/from the repo by default - for local preview of UI changes, use editable install (
uv tool install --force --editable .) or reinstall the package after building - do not restart local
vibejust to verify UI changes unless the user explicitly requests a local-service workflow and the session impact is understood
- prefer the smallest relevant checks first: focused pytest, targeted scripts, or narrow manual validation
- add tests when an existing test pattern already exists
- do not introduce a brand-new test framework unless requested
Testing guidance:
- use pytest-style tests (
test_<feature>.py) colocated or undertests/ - for IM integrations, stub/mock platform clients and validate outbound payload/schema behavior
- for reusable capability-first testing guidance, use
standards/scenario-testing/AGENTS.mdas the entrypoint; project-specific scenario metadata lives undertests/scenarios/ - when a scenario catalog exists, make the scenario ID visible in the automated test and in the PR description
- for multi-step auth/setup flows, update
tests/scenarios/auth_setup/catalog.yamland add or update a closed-loop scenario harness case undertests/scenarios/auth_setup/test_auth_setup_scenarios.py; keep provider-specific parsing and heuristics in focused unit tests - for UI changes, run
npm run buildinui/ - for cross-platform or user-facing verification, use the Docker regression workflow
- until CI fully covers a flow, do a manual sanity check for the affected workflow when practical
- commit messages must use
type(scope): summary - never commit secrets such as tokens or credentials files
- avoid destructive git operations unless the user explicitly requests them
- keep
AGENT_DEFAULT_CWDscoped to_tmp/or another sanitized directory - logs may contain sensitive context; scrub before sharing them back
- be careful with persisted state under
~/.vibe_remote/and_tmp/three-regression/ - do not reset or wipe regression data unless the user explicitly asks for it
- tags follow the latest version number +1 (for example
v1.0.1->v1.0.2) - GitHub-only pre-releases should use the
gh-vX.Y.ZrcNformat (for examplegh-v2.2.8rc2) so they stay distinct from PyPI-triggeringv*tags - GitHub-only pre-releases must include installable artifacts (at minimum a wheel built with
ui/dist) in the GitHub release assets - releases are published automatically by workflow after tagging/push