Commit Graph
17 Commits
Author SHA1 Message Date
Dark-Alex-17 00c3b60c2f feat(graph): stream llm-node completions so node timeout governs long generations
Graph llm nodes (and the structured-output extractor they share with agent
nodes) now obtain the model reply through a quiet streaming transport,
`call_chat_completions_streaming_quiet`, instead of the non-streaming call.
Because chunks arrive as they are generated, reqwest's client-level
`read_timeout` (default 300s) bounds only a genuine stall between chunks and
the node's own `timeout` becomes the effective bound on total generation.
Previously zero bytes arrived until the whole reply finished, so a 300s
read_timeout silently capped every llm node regardless of its `timeout`
(seen live: code-reviewer's `synthesize` node dying on a 61-file review).

The quiet transport renders nothing (silent SseHandler, no spinner), keeps
tool-call handling identical to the non-streaming path (call-loop detection
off), falls back to the non-streaming request for catalog `no_stream` models
(raced against the abort), and never returns partial output as success.

Supporting changes:
- `sse_stream`/`json_stream` keep the typed `reqwest::Error` in the anyhow
  chain so `is_transient_error` still classifies read_timeout stalls as
  transient and `max_attempts` retries them (previously stringified).
- `structured::extract` takes the graph/session AbortSignal and refuses to
  issue an extraction request for an already-aborted graph.
- `run_chat_loop` gains an injectable CompletionRunner seam (owning client
  construction + the before-hook) so the timeout/retry/abort behaviour is
  unit-testable over a paused clock; a fake `impl Client` drives the real
  trait-default streaming for 600s of virtual time; real-socket tests pin
  that read_timeout fires on a stall but not on a slow continuous stream.
2026-09-14 10:50:34 -06:00
Dark-Alex-17 644d899f78 fix: Prevent infinite hangs in coder agent and implement timeouts for LLM API calls and interactive tools 2026-08-14 15:22:25 -06:00
Dark-Alex-17 2596194417 feat: retry LLM API calls once after 401 by force-refreshing the OAuth token
The Client trait's default chat_completions, chat_completions_streaming,
and embeddings methods now classify failures via ApiStatusError: on a
401 with a cached OAuth token, the token is distrusted (identity-aware
marker) and the call retried exactly once — the retry's prepare step
sees the marker and force-refreshes. Streaming retries only while the
SSE handler has received no content, preventing duplicate rendering.
A second 401 propagates the original error; other retry errors
propagate as-is. API-key clients never retry. No backoff by design:
cost is bounded to one refresh + one retry per failing request.
2026-08-14 13:17:56 -06:00
Dark-Alex-17 f3d59ade11 feat: typed ApiStatusError carrying HTTP status through LLM client errors
catch_error and sse_stream now bail with ApiStatusError{status, message}
instead of bare anyhow strings, preserving every existing Display output
byte-for-byte. Enables structural status classification (e.g. 401
detection) via downcast through anyhow context chains.
2026-08-14 13:01:08 -06:00
Dark-Alex-17 8629c1ca15 feat: Improved support for Anthropic's extended thinking 2026-07-17 17:26:41 -06:00
Dark-Alex-17 fa7eadd08a feat: Implemented OAuth support for OpenAI models via Codex endpoints
CI / All (ubuntu-latest) (push) Failing after 24s
CI / All (macos-latest) (push) Has been cancelled
CI / All (windows-latest) (push) Has been cancelled
2026-07-06 11:20:32 -06:00
Dark-Alex-17 597f823bdf fmt: cleaned up graph implementation 2026-05-21 11:27:29 -06:00
Dark-Alex-17 9a061944ae feat: created the RenderMode enum to suppress stdout streaming during parallel graph super-steps 2026-05-20 15:32:03 -06:00
Dark-Alex-17 afa0e4af67 feat: Loki can now update itself via .update and --update commands 2026-05-19 14:29:44 -06:00
Dark-Alex-17 eb2843d38a build: upgraded to the most recent version of reqwest 2026-05-19 11:05:40 -06:00
Dark-Alex-17 0421c9b643 style: Addressed style issues 2026-04-28 08:08:23 -06:00
Dark-Alex-17 f72c7b03f9 test: Updated client stream tests to use the thread_rng from rand 2026-04-09 13:53:52 -06:00
Dark-Alex-17 2a2922760e feat: Implemented retry logic for failed tool invocations so the LLM can learn from the result and try again; Also implemented chain loop detection to prevent loops 2026-02-01 17:06:16 -07:00
Dark-Alex-17 8665604bab Fixed some typos in tool call error messages 2026-01-30 12:25:57 -07:00
Dark-Alex-17 dbf7329e87 refactor: Updated to the most recent Rust version with 2024 syntax 2025-11-07 15:50:55 -07:00
Dark-Alex-17 e28619b55a feat: Removed the server functionality 2025-11-03 14:25:55 -07:00
Dark-Alex-17 216a3d53cd Baseline project 2025-07-06 10:45:42 -06:00