How JJ Pointers Work
When JJ is installed and the workspace is a JJ repository, Smithers captures a JJ pointer (the current change ID or operation ID) at the end of each task attempt. This pointer is stored in the_smithers_attempts table alongside the attempt’s other metadata.
The flow:
- A task executes and makes filesystem changes (via agent tools like
edit,write,bash). - The task completes (successfully or with failure).
- Smithers captures the current JJ state and stores it in
_smithers_attempts.jj_pointer. - On the next attempt or task, JJ continues tracking changes from this point.
What Gets Recorded
Each row in_smithers_attempts includes a jj_pointer column:
| Column | Type | Description |
|---|---|---|
jj_pointer | text (nullable) | The JJ change/operation ID captured after this attempt completed. null if JJ is not installed or the workspace is not a JJ repository. |
fix task had two attempts (perhaps the first failed and was retried). Each attempt has a distinct JJ pointer.
Revert CLI Command
Use therevert command to restore the workspace to the state captured at a specific attempt:
fix task:
RevertStarted and RevertFinished events during the operation.
Revert use cases
- Undo a bad fix: The agent made changes that broke something. Revert to before the fix and try a different approach.
- Compare attempts: Revert to attempt 1, inspect the state, then revert to attempt 2 to compare.
- Debug failures: Revert to the state just before a failure to inspect the workspace.
When JJ Is Not Installed
If JJ is not installed or the workspace is not a JJ repository:jj_pointeris recorded asnullfor all attempts.- The
revertcommand fails with an error explaining that no JJ pointer was found. - All other Smithers functionality works normally. Execution, persistence, resume, and caching are unaffected.
Setting Up JJ
Install JJ:Cache Key Integration
JJ pointers are also used as part of the cache key when caching is enabled (<Workflow cache> or { cache: true }). The cache key includes:
- Workflow name + nodeId
- Prompt text or static payload
- Model ID and parameters
- Tool allowlist and versions
- Output schema signature
- JJ pointer (change or operation ID)
Next Steps
- Resumability — How Smithers persists state for crash recovery.
- Caching — How cache keys work and when to enable caching.
- CLI Reference — All CLI commands including
revert.