# Troubleshooting

Status that looks wrong, busy workspaces, a worker that skips a lump, and other surprises.

## Status looks `toDo` after I merged

The marker string `LUMP: <lumpName> - <contextName>` is missing from git history on `origin/<baseBranch>`. Squash and rebase drop the subject unless you keep that line in the squash message.

Fix: put the string back, or:

```bash
lumpcode context-status myLump myContext --setToFinished
```

That pushes an empty marker commit on the base branch. Use sparingly.

`branchPushed` is not `finished`. Dependencies wait on merge, not on a PR existing.

## `lump-status` versus `daemon-status`

| Command | Question |
| --- | --- |
| `daemon-status` | Is that daemon running? Which lump lines are in flight, when is the next tick, did `local.json` change? |
| `lump-status` | What is each context’s git state? |

They do not answer each other. [Commands](https://www.lumpcode.com/docs/reference/commands.md#three-commands-named-status).

## `workspacePathBusy` / `gitCommonDirBusy`

Another `run` or worker holds the folder or the shared git lock. Manual `run` fails fast. A worker waits up to 15 minutes, then skips and tries next cron.

If you just `stop --force`d, the next acquire removes a stale lock when the PID is dead. You should not delete lock files by hand.

## Dedicated mode wiped my files

`mode: "dedicated"` hard-resets **this clone** to the remote branch before each run. That is why the [worker](https://www.lumpcode.com/docs/start/worker.md) is a second folder you never edit. Laptops stay on `shared`.

There is no undo inside Lumpcode. Recover from git if the work was committed; if it was only in the working tree, it is gone.

## `local.json` missing

`run` and `start` require it. Run `lumpcode project-setup` on a new repo. On a worker clone, run `lumpcode setup` to write `local.json`; do not re-run `project-setup` if `.lumpcode/` is already in git.

## Worker ignored my `local.json` edit

`start` freezes project and local config. `lumpcode daemon-status --json` sets `localConfigStale: true` until you `lumpcode restart`. The running daemon still uses the old settings.

## Worker does not pick up my new lump

1. The lump must be on the branch the worker tracks (usually the primary). Push and merge; wait for the next cron (default five minutes), or `lumpcode restart`.
2. `--include` / `--exclude` on that worker may filter it out.
3. Lump `"disabled": true` soft-skips (exit 0). Local `"disabled": true` pauses every lump on that machine.
4. `maximumNumberOfConcurrentBranches` can skip while older `lump/<name>/*` branches are still open. A branch stops counting when its `LUMP:` lines are already on a non-lump branch, or when its tip is. Keep the line if you squash. Otherwise delete the branch or run `lumpcode clean --lumpName <name>`. See [Day to day](https://www.lumpcode.com/docs/start/worker.md#day-to-day-on-your-laptop).
5. Dedicated discovery allowlist: the lump’s `discoveryBranch` must match configured `primaryBranches`. Launch fails closed on a mismatch; check the worker log.
6. TypeScript lumps that import `@lumpcode/recipes` need `npm install` on the worker clone. The global CLI does not provide those packages.

## `lump-plan` printed no contexts

The path templates or matcher did not hit any files in this repo. `contextListJson` only creates a context when every template resolves to a real path. Change the paths to files that exist here, or start from the [README smoke test](https://www.lumpcode.com/docs/examples/building-blocks.md#smoke-test).

Captures that include dots or spaces become illegal context names. Slug them in `contextMatchFn` / `getContextListFn`.

## `lump-plan` succeeded, `run` did not

`lump-plan` does not pre-flight or take the workspace lock. `run` does. Typical deltas: missing `local.json`, git fetch failure, `workspacePathBusy`, agent binary missing from `PATH` on that machine, dedicated allowlist.

`--prompts` on `lump-plan` can throw inside your `promptFn` even though a default validate passed.

## Agent not found

The preset needs `cursor-agent`, `copilot`, `claude`, `opencode`, or `codex` on `PATH` **on the machine that runs the lump**. A laptop install does not help the worker VM. Log in / auth that CLI on the worker too.

## `systemd --user is not available`

When a step ends, fails, times out, or is stopped, Lumpcode kills the processes it left behind, such as an `npm run dev &` the agent started. On Linux with a `systemd --user` session, each step runs in its own scope and nothing it starts can escape. The daemon prints this warning at startup when it cannot create a scope:

- **macOS, or Linux without a user session bus:** each step runs in its own process group instead. Background processes are still killed, but a process that deliberately leaves its group (`setsid`, a tool that daemonizes) keeps running. On a Linux worker VM, enable lingering for the worker user (`loginctl enable-linger <user>`) and start the daemon from that user's session to get full cleanup.
- **Windows:** leftover processes are not cleaned up.

## Context name rejected

Names must match `^[a-zA-Z0-9_-]+$` and be unique. No `/` in a context `name`. Use `/` only in `dependsOnContexts` as `otherLump/contextName`. Captures from path templates that include dots or spaces will fail; slug them in `contextMatchFn` / `getContextListFn`.

## Too many open branches

The cap is **per lump name**, across every discovery line. A dedicated worker now picks the strongest remaining batch first (context `priority`), so a hotter `feature/*` line is not stuck behind the primary. You can still skip when the cap is already full of open `lump/<name>/*` branches. Keeping the `LUMP:` line is what frees a squashed branch. Merge, raise the cap, or split lumps. See [Day to day](https://www.lumpcode.com/docs/start/worker.md#day-to-day-on-your-laptop).

## Committed daemon file never starts

`.lumpcode/daemons/<id>.json` only starts daemons on a **dedicated worker**. Shared mode ignores the files. File shape: [Start daemons from git](https://www.lumpcode.com/docs/config/daemons.md#file-shape).

1. `discoveryBranch` must be exact (no globs) and equal the expanded primary the file was read from. Push the file on that branch.
2. A `lumpcode start` daemon already using that id is left alone. Stop it, or pick another file stem.
3. `maxParallelRun` in the file plus `workspaceStrategy: checkout` is refused.
4. Wait for the next supervisor pass (about 30s, then every 5 minutes after a successful snapshot), or `lumpcode restart`.
5. `lumpcode daemon-status` should show that id. `lumpcode supervisor-log --noFollow --lines 100` names parse and allowlist failures.

## JSON config cannot see my function

Inline functions need `config.js` or `config.ts`. In JSON, `*Fn` fields are string paths to modules. Precedence if several configs exist: TypeScript wins.

## First PR looks like the prompt is wrong

That is the point of one context per branch. Tweak the prompt, push the lump, merge or close the bad PR. The next context uses the new prompt. Blast radius stays one review.
