Skip to content

Error codes and diagnostics ​

Pling separates a machine-readable code from the localized sentence shown to a person. The code is stable across locales and adapters; the message comes from the shared UI catalog.

ts
import { describePlingError, describePlingDiagnostic } from "@plingjs/ui";

const text = describePlingError(
  { code: "ACTION_UNAVAILABLE", message: "The button is covered by a dialog" },
  (key, params) => translate(locale, key, params),
);

Do not parse the localized text. Branch on code.

Action errors ​

CodeMeaningTypical causeWhat to change
DUPLICATE_ACTION_IDTwo actions use the same idA loop reused a constant idAdd the row key or a namespace
DUPLICATE_STATE_KEYTwo state views use the same keyTwo mounted components expose task_viewGive each view a unique key, or move it to one owner
DUPLICATE_GUIDE_TARGETTwo guide targets share an idCopy-pasted handoff markupUse unique target ids
ACTION_NOT_FOUNDThe model called an id that is not registeredThe declaration was removed, renamed, or never existedDeclare the action or refuse the task honestly
INVALID_ARGSThe tool-call arguments are not valid JSON or do not match the schemaThe model emitted malformed argumentsReport the field and expected shape
INVALID_PARAMSDeclared parameters failed validationMissing required value, wrong type, outside range, bad patternReturn the validation reason; do not retry blindly
PERMISSION_DENIEDThe action exists but policy rejected itThe current role may not perform itChange the policy or the requested operation
ACTION_UNAVAILABLEA precondition is falseDisabled control, covered element, inactive region, failed available()Fix the precondition or explain it to the model
EXECUTION_FAILEDThe action ran but threwBusiness function rejected the operation, network failureSurface the real reason; do not report success
EXPECTATION_FAILEDThe action ran but expect never became trueThe UI did not update, or the expectation was wrongCheck the expectation and the actual page state
HANDOFF_CANCELLEDThe user declined the handoffThe operator chose not to complete the stepStop the task, or ask for a different route
HANDOFF_TIMEOUTThe handoff exceeded its timeoutThe user did not finish in timeExtend the timeout only if the business allows it
HANDOFF_FAILEDThe handoff was marked done but its expectation failedThe user reported completion before the result existedRe-check the page and ask again
STEP_FAILEDA step inside a compound action failedOne step in steps returned an errorReport the failing step, not the whole flow as a generic failure
HOOK_BLOCKEDA lifecycle hook blocked the actionPolicy hook rejected the callInspect the hook result
LOOP_DETECTEDThe agent repeated the same tool call too oftenA missing result, wrong expectation, or a loop in the pageFix the page or stop the run

Runtime errors ​

CodeMeaningTypical cause
NOT_CONFIGUREDThe runtime has no usable model connectionMissing base URL, model, or key
LLM_FAILEDThe model request failedNetwork, CORS, gateway, authentication, or provider error
SEND_FAILEDThe message could not be delivered to the runtimeThe session was disposed or the request was cancelled

NOT_CONFIGURED is a readiness issue, not a model failure. The UI should point to the missing field instead of showing a generic request error.

Configuration diagnostics ​

These codes come from resolveAgentConfig and are rendered through describePlingDiagnostic:

CodeMissing or invalid
MODEL_BASE_URL_MISSINGOpenAI-compatible base URL
MODEL_NAME_MISSINGModel name
MODEL_API_KEY_MISSINGAPI key, when the endpoint requires one
LIMITS_INVALIDmaxTurns, context budget, reserve, compaction ratio, or recent-history size
RETRY_INVALIDRetry count or delays

A relative base URL (/llm/v1) is valid when the application provides a same-origin proxy. It is not a missing value.

Limits ​

SettingDefaultValid range or interaction
maxTurns10At least 1; demo fixtures may set 100
contextTokens8192At least 1024
reserveForOutput1024At least 0; contextTokens - reserveForOutput must leave at least 1024
compactRatio0.8Greater than 0 and at most 1
keepRecent6At least 0
maxTokens1024Per-response output budget
minActionIntervalMs0Delay between actions in one batch

Demo fixtures set maxTurns: 100 explicitly. The production default remains 10.

Reading an error correctly ​

  1. Read code first.
  2. Read the raw message only as a secondary detail.
  3. Look at the current snapshot: is the action registered, available, and in an active region?
  4. For EXPECTATION_FAILED, compare the expected result with the actual page state; do not simply retry.
  5. For ACTION_NOT_FOUND, check whether the page changed between snapshot and call.
  6. For LLM_FAILED, check the gateway, CORS, credentials, and provider status before changing page declarations.

Adapter behavior ​

All four adapters use the same executor and the same error codes. The UI may render the message differently:

AdapterError surface
Vue 3<AgentDock>, <AgentInline>, <AgentChat>, debug inspector
React<AgentDock>, <AgentChat>
Vanilla / jQuerypling.dock() and session events
Vue 2.7shared pling.dock()

Do not map codes to adapter-specific strings in business code. Use describePlingError with the active UI locale.

Version and compatibility ​

ItemValue
Applies toRuntime and adapter error surfaces in @plingjs/* 0.1.0-alpha.2
Introduced0.1.0-alpha.2 (first published alpha)
RuntimeBrowsers with ES2022 modules; Node.js 20 or later for Node-side use
Peer dependenciesThose of the adapter being used
StabilityPre-1.0 alpha; codes may be added, and an existing code's meaning is not silently changed

The code strings and diagnostic fields on this page are the public contract for this version. A new code is an additive change; changing an existing code's category or meaning requires a documented breaking change.