When things go wrong
Reading an error, surviving a crash, and restoring a backup.
You press Send and an alert appears above the composer. A few minutes later, in another chat, a command shows as failed and the assistant keeps writing. Both failures leave something you can inspect. Where the failure appears tells you which part of the work needs your attention.
In this chapter
- Tell a refused request from an ended run or a failed tool call.
- Retry an unconfirmed send and recognize the outcomes that offer Resume response.
- Read the host’s logs and restore a stopped copy of its data directory.
Read the place where the error appears
| Feature | Request | Run | Tool call |
|---|---|---|---|
| What arrives | An HTTP error status and message | A conversation snapshot with the run outcome | A failed tool result in the transcript |
| Where to look | The alert or sign-in screen | The status and alert above the composer | The tool activity row |
| What to do | Address the message and retry the same send if delivery is uncertain | Use Resume response when the chat offers it | Open the result to inspect the reported failure |
Choose up to two columns
Choose up to two columns
| Feature | Request | Run | Tool call |
|---|---|---|---|
| What arrives | An HTTP error status and message | A conversation snapshot with the run outcome | A failed tool result in the transcript |
| Where to look | The alert or sign-in screen | The status and alert above the composer | The tool activity row |
| What to do | Address the message and retry the same send if delivery is uncertain | Use Resume response when the chat offers it | Open the result to inspect the reported failure |
Start with Send. The browser asks the hostThe computer running the Pipal server process. to accept your input. A refusal comes back on that request, with a status such as 409 and a message such as “This conversation is already running.” If the connection dropped before the reply arrived, the browser may have no status at all. “Could not reach Pipal” leaves the question of acceptance open. api.ts index.ts
Once the host accepts your input, the outcome comes through the conversation snapshot, the current view the server sends to the tab. An accepted request can therefore have a successful HTTP reply and still leave you looking at a failed run. Read the alert above the composer for the run error, or the status line for Response stopped. view.ts App.svelte
A failed tool result belongs to the transcript. Open the activity row and read the output. For example, a denied workspace action gives the model a failure it can respond to, and a failed command can provide enough detail for the model to change its approach. The failed row can stay visible even after the assistant writes an answer. README.md ChatEntry.svelte
If a chat’s locationThe place a chat uses for project tools, either the Pipal host, an account reached over SSH, or a Docker project. is disabled or unavailable, the composer names it and says “This chat needs its original workspace.” You can still read the chat and send a follow-up. A workspace call that reaches core’s tool guard without a current binding fails with “<location> is unavailable for this chat. Check Developer workspace in Settings.” For a new chat, the browser blocks Send while the selected location is disabled or unavailable. App.svelte index.ts
Open Settings → Workspace and re-enable the original location if it was turned off. For This machine, that gives approved commands the service user’s access, including to the chat database and saved model login. If an enabled location shows Unavailable, fix the cause and use Retry connection. The old chat regains access if the project identity still matches. Start a new chat if the project identity changed or you want a different location. DeveloperWorkspace.svelte index.ts
If a package download fails in Docker, check the hint shown in Runtime and Settings → Workspace, “Shell commands run without network access.” Optional web tools can look up documentation while the shell stays offline. workspace-choice.ts project-shell.ts
Deep diveRead the HTTP status and the error text together
RuntimeError carries an HTTP status and sometimes a machine-readable code. The Hono handler also accepts HTTPException for checks in the host. The browser’s ApiError preserves the status and reads the returned message. errors.ts app.ts api.ts
| Status | Causes to check |
|---|---|
| 400 | Bad JSON or fields, invalid settings, input or cursor, or an attachment preparation error such as an unreadable PDF or an image sent to a text-only model. Creating a chat with a location its profile cannot use returns “This profile cannot use the selected workspace.” request.ts index.ts uploads.ts |
| 401 | Missing or expired session, or a wrong access token. app.ts |
| 403 | Unrecognized host, mismatched write origin, refused passkey verification or code, or artifact preview outside a same-origin iframe. app.ts passkeys.ts |
| 404 | Missing conversation, upload, artifact or route, or another missing resource such as a sign-in attempt. An attempt owned by a different session also looks missing. index.ts uploads.ts app.ts provider-login.ts |
| 409 | The requested action conflicts with current state. Examples include changed content under a used request ID, a running or archived chat, and a routine edited since you opened it. index.ts routines.ts |
| 413 | A body or attachment exceeds its size limit. The host caps ordinary requests at 128 KiB, raw uploads at 10 MiB and extension requests at 8 MiB. Message attachment batches have their own limits. app.ts uploads.ts |
| 415 | Wrong content type for a JSON request, or unsupported upload bytes or type. request.ts uploads.ts |
| 429 | The host has reached its concurrent run, attachment preparation, passkey flow or passkey verification limit. index.ts uploads.ts passkeys.ts |
| 500 | An unexpected exception, or failure to remove the saved ChatGPT connection. app.ts provider-login.ts |
| 503 | Core is closing during search, Send or Resume, or a development project could not be opened. index.ts |
In create(), an unavailable location returns 409 and tells you to choose an enabled location or check Developer workspace in Settings. If the final check detects a replaced backend, core returns 409 and asks you to review the selected location and retry. In patch(), changing the location returns 409 with “Start a new chat to select another workspace location.” The same rule applies to changing the project. index.ts
For the errors attached to each operation, see The HTTP API at a glance. A ChatGPT sign-in can also fail after the host accepted the request. Polling the attempt then returns status: 'failed' and a fixed message, such as “Sign-in expired. Start a new sign-in to retry.” provider-login.ts
“Exa rate limit reached (HTTP 429). Try again later.” in a tool result means the host reached Exa and the service limited the search. A page read can report the same condition for Jina Reader. The tool activity identifies which lookup failed after Send was accepted. public-web.ts
Retry delivery or continue the reply
If an ordinary send fails, keep the chat open and check whether your message appeared before you press Send again. The browser saves the pending request ID along with a fingerprint of the outgoing content. With the same input, it reuses the ID, including when it can reuse already uploaded originals. The host can return the original receipt if it accepted the message before the connection failed. Editing the outgoing content creates a different attempt. App.svelte index.ts
- Browser
- Hono app.ts
- Core index.ts
- SQLite
Time limit
Browser → Hono · Send
You send a message
The tab posts your input to an existing chat.
Hono → Core · Submit
The host asks core to accept it
Core checks whether this chat can start a run, the work needed to answer your message.
Core → SQLite · Save input
The request has a home
Core saves the accepted input and the deadline together in
durable.sqlite.Hono → Browser · 202
The host returns a receipt
The receipt identifies the accepted input. The conversation stream carries the outcome separately.
Core → SQLite · Mark timeout
The deadline runs out
Core saves the time-limit marker, then requests the abort.
Hono → Browser · Failed view
The chat offers another attempt
In this unarchived main chat, the snapshot carries the time-limit error and the ID of the aborted run. The tab shows Resume response.
Browser → Hono · Resume
You choose Resume response
The tab posts the snapshot’s
resumableRunIdas{runId}. Your current composer draft stays where it is.Hono → Core · Continue
Core checks the run ID
Core looks for a prior resume receipt, then checks that the run is still eligible to continue.
Core → SQLite · New run
Core saves a continuation
The next run gets a fresh deadline and round count. Its prompt points to the saved conversation and tool results.
Hono → Browser · 202
The host acknowledges the continuation
If this reply is lost, resending Resume with the same run ID returns the existing receipt.
Hono → Browser · New view
The tab follows the new run
Updates travel on the conversation stream and can arrive before the HTTP receipt.
Reserved final answer
Browser → Hono · Send
You send a message
The tab posts your input to an existing chat.
Hono → Core · Submit
The host asks core to accept it
Core checks whether this chat can start a run, the work needed to answer your message.
Core → SQLite · Save input
The request has a home
Core saves the accepted input and the deadline together in
durable.sqlite.Hono → Browser · 202
The host returns a receipt
The receipt identifies the accepted input. The conversation stream carries the outcome separately.
Core → SQLite · Save task ID
Pipal reserves the final request for text
Core stores the task ID before asking for a final answer using the available results.
Hono → Browser · Idle view
A finished answer can still offer Resume
The snapshot is
idlewith a resumable run ID. The browser shows “This response reached its turn limit.” alongside Resume response.Browser → Hono · Resume
You choose Resume response
The tab posts the snapshot’s
resumableRunIdas{runId}. Your current composer draft stays where it is.Hono → Core · Continue
Core checks the run ID
Core looks for a prior resume receipt, then checks that the run is still eligible to continue.
Core → SQLite · New run
Core saves a continuation
The next run gets a fresh deadline and round count. Its prompt points to the saved conversation and tool results.
Hono → Browser · 202
The host acknowledges the continuation
If this reply is lost, resending Resume with the same run ID returns the existing receipt.
Hono → Browser · New view
The tab follows the new run
Updates travel on the conversation stream and can arrive before the HTTP receipt.
Browser → Hono
You send a message
The tab posts your input to an existing chat.
“This response reached its turn limit.” appears as an alert when Pi hits the hard cap, or as a status line after a successful reserved final answer. Read that answer to see what remains. status-text.ts App.svelte
Either turn-budget outcome can offer Resume response in an unarchived main chat, as can a timeout or Response stopped. The button continues from saved work and keeps your draft. For other run failures, address the error and send a follow-up. view.ts App.svelte
Deep diveHow Pi’s run reasons become browser messages
Once a run settles, Pipal maps Pi’s failure to status and error. For a model error, publicFailureReason() also maps the diagnostic to a fixed category, such as authentication or quota. The browser shows the category’s explanation. The provider’s raw diagnostic stays out of the snapshot. view.ts status-text.ts
const failure = live.run ? undefined : live.runFailure;const reason = failure?.reason;const error = reason === 'aborted' ? meta.timeLimit && timeLimitError : reason?.replaceAll('_', ' ');| Settled outcome | Snapshot | What the chat shows | Resume in an unarchived main chat |
|---|---|---|---|
| Successful answer on the reserved final request | idle |
This response reached its turn limit. | Yes |
aborted without timeout marker |
stopped |
Response stopped | Yes |
aborted with timeout marker |
failed, time limit reached |
This response reached its time limit. | Yes |
turn_limit |
failed, turn limit |
This response reached its turn limit. | Yes |
model_error |
failed, model error, failureReason |
The category’s message, e.g. “The provider rejected the credentials.” | No |
no_model |
failed |
no model | No |
interrupted |
failed |
interrupted | No |
restart_limit |
failed |
restart limit | No |
faulted |
failed |
faulted | No |
orphaned |
failed |
orphaned | No |
reset |
failed |
reset | No |
nothing_to_answer |
failed |
nothing to answer | No |
interrupted can follow a crash during generation when the retry budget runs out. restart_limit can follow repeated interruptions of a task before it commits new state. Pipal allows up to two model retries and sets Pi’s restart limit to three. Pi marks failed attempts in its records. A failed assistant entry in the transcript can coexist with a later successful attempt. README.md index.ts view.ts
If the chat shows no model, check whether its selected model is still available. If a reply needs a summary to continue and the summary fails, the chat can report “Earlier messages could not be summarized.” Open the context meter for the last compaction failure. A background summary can fail while the reply itself succeeds. contracts.ts run-status.spec.ts
The Stop button posts to POST /api/v1/conversations/:id/stop?runId=<id> with the active task ID. Resume response uses the settled snapshot’s resumableRunId in the body of POST /api/v1/conversations/:id/resume. The new input is marked pipal.resume. After an abort, it can carry up to 16,384 UTF-16 code units of saved assistant text from that attempt. A duplicate Resume returns its saved receipt, and a stale ID without a receipt gets 409. The runtime tests reopen the store before resuming both a timeout and a reserved final answer. app.ts index.ts runtime.test.ts App.svelte
Read the host log when the tab has gone quiet
Look in the terminal that started Pipal or the service log. A successful start prints the JSON event ready, with version, origin and the workspace url. It includes accessTokenFile in token mode or passkeyCodeFile if the host issued a code at startup. These fields give paths to the private files. A start that fails prints a plain error message and sets exit code 1. main.ts
If an enabled location fails its startup check, loadWorkspaceLocations() logs Workspace <id> unavailable: <reason>. The host can reach ready while the location stays enabled and its tools are unavailable. Use Retry connection for a failed probe shown as Unavailable. Changes to the destination in TOML take effect after a restart. workspace-locations.ts main.ts
If you see request_failed, the host caught an unexpected exception while handling an HTTP request. Its only additional field is method. The response is a generic 500. If you see tool_denied, read its tool and conversation fields. The extension tool failed the profile grant check. The failed result can show what happened in the chat. app.ts index.ts
The event storage_failed has no additional fields. It means the runtime closed with a failure. The host stops serving and sets exit code 1. Once the storage problem is addressed and the process has exited, start Pipal again if your service manager has not already done so. Sign in to inspect the saved chat. Durable by default explains what Pipal can recover after the process ends. main.ts pipal.service
If passkey_code_cleanup_failed appears, enrollment consumed the grant but the host could not remove its code file. The event has no additional fields. passkeys.ts
Copy the whole data directory while Pipal is stopped
- Archive the whole directory while stopped
data/- Chats and unfinished work
durable.sqliteInclude SQLite sidecar files if present. Copy the directory in one stopped interval. - Runtime ownership file
owner.sqliteOwnership is a live SQLite lock. The copied file can be opened by the restored process. - Original images and PDFs
uploads/ - Workspace credential in token mode
access-token - Workspace credentials in passkey mode
passkeys/ - Saved ChatGPT credentials, when present
chatgpt-auth.json - Enabled locations and the default for new chats
workspace-settings.json - Project files on This machine, when used
projects/ - State kept here by host extensions
extensions/
- Archive the whole directory while stopped
- Chats and unfinished workInclude SQLite sidecar files if present. Copy the directory in one stopped interval.
- Runtime ownership fileOwnership is a live SQLite lock. The copied file can be opened by the restored process.
- Original images and PDFs
uploads/ - Workspace credential in token mode
access-token - Workspace credentials in passkey mode
passkeys/ - Saved ChatGPT credentials, when present
chatgpt-auth.json - Enabled locations and the default for new chats
workspace-settings.json - Project files on This machine, when used
projects/ - State kept here by host extensions
extensions/
Stop the host with Ctrl+C in its terminal or with SIGTERM, then wait for exit. Keep every host using the directory stopped until the copy finishes. Find the data directoryThe private folder on the host where Pipal keeps conversations, uploads, sign-in records, and other state. through storage.data_dir and archive the directory contents, including any SQLite files alongside the main database. Those files can hold committed changes. backup.md
The archive is private because it holds credentials alongside chats and original uploads. It includes workspace-settings.json and projects under projects/ on This machine. Stop any apps writing to those projects before copying them. Save the matching configuration and profile directory separately. Record the Pipal revision (git rev-parse HEAD from the checkout) beside the backup, and supply provider credentials from your usual secret store. backup.md workspace-locations.ts
For SSH machine, save projects_root, any separately mapped project directories, and the dedicated SSH identity and verified host key. Detached services can keep writing after Pipal stops. For a consistent backup, stop the relevant writers or use database dumps. Back up application volumes and databases separately, along with any Docker project volume. Start a new chat if the workspace identity changed. This includes local projects extracted into the new restore directory. backup.md development-runner.mjs
Restore only a trusted archive. Set backup_dir to the directory containing the archive you want to restore, or keep its value from the backup step if you are in the same shell. This extracts into a new private directory.
restore_dir=$(mktemp -d "$HOME/pipal-restore.XXXXXX") && tar -xzf "${backup_dir:?Set backup_dir to the backup directory}/data.tar.gz" -C "$restore_dir"After successful extraction, set storage.data_dir in a copy of your config to the absolute path in restore_dir. Keep the profile and extension paths valid. Relative paths are resolved from the config file’s directory. backup.md config.ts
Keep the original host stopped. Before starting the copy, account for unfinished work that might touch an outside service, including when you decide which extensions to enable. Pipal checks saved deadlines before resuming the scheduler. Work past its adjusted deadline can end with the time-limit error. An approval can stay parked for an enabled location, while startup interrupts saved workspace work at disabled locations. backup.md index.ts
From the matching Pipal checkout with its web build in place, start with PIPAL_CONFIG=/absolute/path/to/restored-config.toml pnpm start, substituting the path to the copied config. Sign in with the restored token or a passkey enrolled for the configured hostname. Check a known conversation’s history and settings, and keep the original directory until you have verified the restore. backup.md main.ts
Which checks would catch a regression in these paths before you ship a change? Changing Pipal follows the tests from an HTTP refusal through to a real process crash.
Recap
- HTTP errors describe a request, snapshot errors describe a run, and failed tool rows describe individual calls.
- Retry an unconfirmed send with the same input. Resume response starts a fresh run after Stop, time limit, or either turn-budget outcome.
- Back up the stopped data directory as a unit. Save project data outside it separately and verify the restored copy.
- The tab lost its connection just after Send. Why keep the outgoing text and attachments the same when retrying?
- The browser can reuse the request ID and retrieve an existing receipt.
- The run deadline starts only once the tab sees the reply.
- A retry uploads a second set of originals in every case.
Answer and explanation
The browser can reuse the request ID and retrieve an existing receipt.
The pending attempt is tied to the outgoing content. The host recognizes the same input under the same ID even if the original HTTP reply was lost.
- The assistant delivered a patch but says tests remain pending. The chat shows “This response reached its turn limit.” and offers Resume response. What will the button do?
- Retry delivery of the original Send
- Admit a new run from the saved conversation and results
- Resume the same generation with the old round count
Answer and explanation
Admit a new run from the saved conversation and results
The reserved final request can deliver an answer and still leave a continuation. Resume starts a new run with a fresh deadline and round count.
- You restore a backup with a chat waiting for approval, and its original workspace is still enabled, reachable and matches the saved identity. What should you expect?
- The old browser cookie signs you in.
- The approval becomes automatic on the restored host.
- Sign in again and check the chat for the pending decision.
Answer and explanation
Sign in again and check the chat for the pending decision.
The approval is part of the saved work. Browser sessions were in the old process’s memory.
The tab lost its connection just after Send. Why keep the outgoing text and attachments the same when retrying?
The assistant delivered a patch but says tests remain pending. The chat shows “This response reached its turn limit.” and offers Resume response. What will the button do?
You restore a backup with a chat waiting for approval, and its original workspace is still enabled, reachable and matches the saved identity. What should you expect?