iflytek/astron-agent · error · PluginExc

-1

-1

Error message

璇锋眰鏈嶅姟瓒呮椂

What it means

PluginExc with code -1 and message '请求服务超时' (the mojibake string 璇锋眰鏈嶅姞瓒呮椂 is GBK-misdecoded UTF-8) raised by _handle_api_timeout_error in the LLM model wrapper when the upstream model API call times out (openai APITimeoutError). The original timeout is attached as om=str(error).

Solutions

  1. Retry the request; transient provider latency is the most common cause
  2. Increase the model API timeout in the plugin/model configuration
  3. Reduce prompt size or enable streaming so first tokens arrive sooner
  4. Check model provider status and network connectivity from the agent service to the endpoint
Defensive patterns

Strategy: retry

Try / catch

try:
    stream = await model.astream(messages)
except PluginExc as e:
    if e.code == -1:
        await asyncio.sleep(backoff)
        retry_with_longer_timeout()

Prevention

When it happens

Trigger: Streaming or non-streaming LLM request exceeds the client's configured timeout: slow model inference, very long prompts, network congestion, or an unreachable/slow model endpoint.

Common situations: Model provider latency spikes or outages; prompts near the context limit causing long time-to-first-token; timeout set too low in plugin/model configuration; egress network issues in the deployment environment.

Understand the failure class

Background: Request timed out: what client-side request timeouts mean across libraries (Request timed out, TIMED_OUT, APITimeoutError) — this error's family across 39 libraries.

Related errors


AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12). Data as JSON: /api/errors/8a95a10ce07c9b63. Report an issue: GitHub.

Appendix: source

Thrown at core/agent/domain/models/base.py:187

                raise
            # Some older OpenAI-compatible providers reject stream_options.
            # A 400/422 validation response arrives before the SDK opens an SSE
            # stream, so no client-visible output has been emitted. Cache the
            # capability to avoid repeating the rejected request.
            self._stream_usage_supported = False
            request_kwargs.pop("stream_options", None)
            return await self.llm.chat.completions.create(**request_kwargs)

    def _log_messages_to_span(self, sp: Span, messages: list) -> None:
        for message in messages:
            sp.add_info_events({message.get("role"): message.get("content")})

    def _log_request_info_to_span(self, sp: Span, stream: bool) -> None:
        sp.add_info_events({"model": self.name})
        sp.add_info_events({"stream": stream})

    def _handle_api_timeout_error(self, error: APITimeoutError) -> None:
        raise PluginExc(-1, "璇锋眰鏈嶅姟瓒呮椂", om=str(error)) from error

    def _handle_api_error(self, error: APIError, sp: Optional[Span]) -> None:
        if sp is not None:
            sp.add_info_events({"code": error.code or "null"})
            sp.add_info_events({"message": error.message})
            sp.add_info_events(
                {"converted-code": str(getattr(error, "code", "unknown"))}
            )
            sp.add_info_events({"converted-message": error.message})
        llm_plugin_error(error.code, error.message)

    def _handle_general_error(self, error: Exception, sp: Optional[Span]) -> None:
        if sp is not None:
            sp.add_info_events({"code": ""})
            sp.add_info_events({"message": str(error)})
            sp.add_info_events({"converted-code": "-1"})
            sp.add_info_events({"converted-message": str(error)})
        llm_plugin_error("-1", str(error))

View on GitHub (pinned to 5e758547a8)