This document describes the current behavior of the workspace-sync doctor command.
outline-agent doctor workspace-sync checks whether local agent workspace state still matches Outline.
It is meant for cases like:
- the agent was offline
- webhook delivery was missed
- local collection / document / thread state may now be stale
The command only checks the workspace root from the active config / CLI overrides.
That means the result is only meaningful if doctor is pointed at the same config and workspace root that the agent used when it created local state.
Typical examples:
outline-agent doctor workspace-syncor explicitly:
outline-agent doctor workspace-sync \
--config-path /path/to/config.yaml \
--workspace-root /path/to/agentsIf doctor reports:
checked collections: 0checked documents: 0checked threads: 0
the most common cause is that it is looking at the wrong workspace_root.
Default depth is:
outline-agent doctor workspace-sync --depth coarseCoarse mode checks:
- local collections whose remote collection is gone
- local documents whose remote document is deleted or gone
- active local threads that obviously hang off already-archived local documents
- missing local metadata files like
state.json/comments.json
It does not do remote thread-root validation.
Deep mode adds thread-level checks:
outline-agent doctor workspace-sync --depth deepDeep mode additionally checks:
- active thread whose remote root comment is gone
- active thread whose remote document comments cannot confirm the root
- deleted-but-still-active local thread workspaces
Deep mode groups thread checks by document and fetches comments once per document when possible.
A local collection is treated as deleted when:
collections.info(id)returns not found
A local document is treated as deleted when either of these is true:
documents.info(id)returns not founddocuments.info(id)succeeds butdeletedAt != null
This means documents in Outline Trash are currently treated as deleted for doctor purposes.
This is intentional: the command is trying to answer whether a local active workspace is still safe to trust as live state.
If Outline returns a permission-style error, doctor does not abort the whole scan.
Instead it reports findings like:
inaccessible_remote_collectioninaccessible_remote_documentinaccessible_remote_comments
This means:
- the local workspace exists
- the current API key cannot confirm remote state for that object
These are warnings for operator review, not proof of deletion.
By default, doctor is read-only:
outline-agent doctor workspace-syncTo archive local stale state:
outline-agent doctor workspace-sync --fixThe flow is:
- run diagnostics
- show findings
- show a repair plan
- ask for confirmation
- apply local archival repairs
- run post-fix verification
By default, --fix plans repairs for:
- missing remote collections
- deleted / missing remote documents
- orphaned active threads
- deleted-but-not-archived threads
- active threads whose parent is already archived locally
Repairs are local archival actions only:
- archive collection workspace
- archive document workspace
- archive thread workspace
It does not permanently delete local data.
403/inaccessible findings are not included in the repair plan by default.
During interactive --fix, if inaccessible findings exist, doctor asks:
Include N inaccessible (403) local workspaces in the repair plan? [y/N]
Default is N.
If the user answers yes, the inaccessible items are added to the repair plan and can then be archived locally.
For scripting:
outline-agent doctor workspace-sync --jsonWith --fix --json, the output includes the report, repair plan, repair run, and final verification report when applicable.
0: no findings1: findings detected2: command execution or repair phase failed
Check only:
outline-agent doctor workspace-syncCheck with explicit config:
outline-agent doctor workspace-sync \
--config-path ~/.outline-agent/config.yaml \
--workspace-root .data/agentsDeep validation:
outline-agent doctor workspace-sync --depth deepInteractive repair:
outline-agent doctor workspace-sync --fixNon-interactive repair:
outline-agent doctor workspace-sync --fix --yes