Mark Pitt
claude-skills
  1. claude-skills
  2. AI engineering
  3. pi-agent-extensions
  4. references/recurring-bugs.md

A file in pi-agent-extensions

references/recurring-bugs.md

Markdown 6.7 KB
recurring-bugs.mdMarkdown, rendered

Recurring provider and extension bugs

Each row gives a symptom, the cause, a check that confirms it, and the fix. Most provider faults in pi are silent: an unknown option is ignored, a stale list is kept, a key is cached. Start from the check, not the symptom's first guess.

Evidence for what recurs: in the operator's pi session files (49 files, counted for this skill), 94 assistant messages carry an error stop reason, and 74 of the 101 stored error messages contain the string 429. Rate limiting and quota responses are therefore the most frequent recorded provider failure. Two transport failure entries were also recorded. The counts do not show the cause of each error, and the message text is not reproduced here.

#SymptomCauseCheckFix
1A live model list never changesAn option name is misspelt, or the legacy and complete forms are mixed (refreshModels on createProvider is not the name; the option is fetchModels)scripts/check_extension_names.py on the file; grep -a -o '.\{0,80\}<name>.\{0,80\}' <pi binary> for an object key the script does not readUse the documented name for the form in use
2Refresh never runs, offline or in print moderefreshModels is skipped when context.allowNetwork is false or the signal is abortedRead the context flags in the handler; run once with networkExpected offline. Serve the saved snapshot, or say so in the report
3/v1/models succeeds, chat says no model is loadedThe server lists models it can load but is not serving themCompare /v1/models with the server's loaded setFilter to loaded models in fetchModels (see the example)
4404 on chat and on model refreshbaseUrl lacks /v1; pi appends /chat/completions and /modelscurl the composed URL with the keyPut /v1 in baseUrl
5Built-in provider catalogue vanishedLegacy models supplied while the intent was a redirect/model shows only the extension's modelsRegister only baseUrl or headers for a redirect
6A model's settings are not the ones writtenAn entry with the same id replaces the built-in model; a modelOverrides key with an unknown ID is ignoredpi --list-models; compare the model's fieldsUse modelOverrides for metadata; check the ID spelling
7A rotated key still failsAn auth.json !command key is cached for the life of the processRestart pi and retryRestart, or move to a models.json !command, which runs per request
8A new key in config is ignoredA stored /login credential in auth.json outranks models.json apiKeyauth.json has an entry for the providerRemove or update the stored credential
9Key works in one shell onlyThe variable is set in a shell, not in the process that starts pienv inside the same shell as piExport it before starting pi, or set it in a stored credential's env object
10Provider missing from /modelIts credential does not resolve/model lists only providers with usable authFix the credential resolution
11Wrong reasoning output, or a reasoning field rejectedCompatibility detected from an unknown host; thinkingFormat wrong for the serverRead the request body with a payload-logging handler in a private fileSet thinkingFormat and the related fields for the server, verified against its behaviour
12Tool results rejected by a proxyThe proxy needs a name on tool results, or a tools field with tool historyThe error text and the proxy's versionSet requiresToolResultName or requiresToolsWithToolHistory
13developer role rejectedThe server accepts only systemError on first requestsupportsDeveloperRole: false
14Prompt cache misses every runA before_agent_start handler returns systemPrompt, replacing the whole promptTurn on the showCacheMissNotices setting (documented in settings.md) and read the noticesChange systemPromptOptions.sections or promptGuidelines instead
15Context overflow not recoveredThe provider's overflow message is not recognised, so pi does not compact and retryThe error textNormalise only that provider's overflow message to context_length_exceeded, guarded. Do not map rate limits to overflow
16A handler's return value does nothingThe event is notification-only (the docs name thinking_level_select; the handler-composition table lists the notification pattern)The event's section in api-surface.mdMove the change into a gate or transform event that accepts a return value
17Session breaks after a context handlerA context_with_system handler dropped the system message at index 0Pi reports an error on the next requestKeep index 0 and check with getCurrentSystemPrompt()
18A blocked command still runs, or an edited command runs uncheckedtool_call input is changed after the check, or the handler does not block on the failure pathTest the handler with a benign and an inert payloadValidate after mutation; fail closed when the safety decision cannot be made
19Secrets in a log fileA payload or header logger writes the requestRead the log file's contents before sharingLog names and sizes only; keep the file private and out of repositories
20Claude rules missing from a sessionA rule has paths: and no matching file was touchedExpected behaviour; check the rule's pathsNot a fault. Touch a matching file, or remove paths if it must always load
21Claude memory index truncatedThe index is larger than the loaded partMeasure it with instruction-context-budgetShorten the index and move detail to topic files
22Extension not discoveredPlaced one level too deep, or in an untrusted project's .pi/extensionspi startup output; trust.jsonMove it to a discovered location, or trust the project

Two checks that catch most of these

  1. Name check. Run scripts/check_extension_names.py on every extension file. It catches a wrong method or event name, not a wrong object key. Keys in createProvider and registerProvider config objects are checked by reading the docs, or by searching the binary with context, as the table shows.
  2. Model list check. Run pi --list-models and compare the output with the server's own list, read by hand. A list that matches the server is evidence. A list that matches the code is not.

Things this file does not establish

  • Whether any of the numbered causes applies to a given server. Each row is a cause to test, not a finding.
  • The exact text of the operator's stored errors. The counts above are from the files, and the messages are not copied into this skill.