Skip to content

Commit b370d66

Browse files
committed
feat(providers): share authentication and resilience
1 parent 4bad70e commit b370d66

20 files changed

Lines changed: 1148 additions & 5281 deletions

Cargo.lock

Lines changed: 41 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "kit"
3-
version = "0.1.108"
3+
version = "0.1.109"
44
edition = "2024"
55
rust-version = "1.94.0"
66
publish = false
@@ -21,6 +21,7 @@ agentkit-loop = { version = "=0.10.10", features = ["otel"] }
2121
agentkit-mcp = "=0.10.6"
2222
agentkit-http = "=0.10.5"
2323
agentkit-plugins = "=0.10.7"
24+
agentkit-provider-openai = "=0.10.5"
2425
agentkit-provider-openrouter = "=0.10.7"
2526
agentkit-task-manager = "=0.10.7"
2627
agentkit-tool-compose = { version = "=0.10.9", default-features = false, features = ["runlet"] }
@@ -37,8 +38,6 @@ crossterm = { version = "=0.29.0", features = ["event-stream"] }
3738
flate2 = "=1.1.10"
3839
futures-util = "=0.3.34"
3940
getrandom = "=0.4.3"
40-
h2 = "=0.4.19"
41-
httpdate = "=1.0.3"
4241
hyper = "=1.11.1"
4342
hyper-util = { version = "=0.1.20", features = ["server", "http1", "http2", "tokio"] }
4443
image = { version = "=0.25.10", default-features = false, features = ["gif", "jpeg", "png", "webp"] }
@@ -88,18 +87,19 @@ tempfile = "=3.27.0"
8887
tokio = { version = "=1.53.1", features = ["test-util"] }
8988

9089
[patch.crates-io]
91-
agentkit-acp = { git = "https://github.com/danielkov/agentkit.git", rev = "1204e2b31d77ca820c9302fab2769e0b5c0c1c10" }
92-
agentkit-adapter-completions = { git = "https://github.com/danielkov/agentkit.git", rev = "1204e2b31d77ca820c9302fab2769e0b5c0c1c10" }
93-
agentkit-core = { git = "https://github.com/danielkov/agentkit.git", rev = "1204e2b31d77ca820c9302fab2769e0b5c0c1c10" }
94-
agentkit-context = { git = "https://github.com/danielkov/agentkit.git", rev = "1204e2b31d77ca820c9302fab2769e0b5c0c1c10" }
95-
agentkit-compaction = { git = "https://github.com/danielkov/agentkit.git", rev = "1204e2b31d77ca820c9302fab2769e0b5c0c1c10" }
96-
agentkit-loop = { git = "https://github.com/danielkov/agentkit.git", rev = "1204e2b31d77ca820c9302fab2769e0b5c0c1c10" }
97-
agentkit-mcp = { git = "https://github.com/danielkov/agentkit.git", rev = "1204e2b31d77ca820c9302fab2769e0b5c0c1c10" }
98-
agentkit-http = { git = "https://github.com/danielkov/agentkit.git", rev = "1204e2b31d77ca820c9302fab2769e0b5c0c1c10" }
99-
agentkit-plugins = { git = "https://github.com/danielkov/agentkit.git", rev = "1204e2b31d77ca820c9302fab2769e0b5c0c1c10" }
100-
agentkit-provider-openrouter = { git = "https://github.com/danielkov/agentkit.git", rev = "1204e2b31d77ca820c9302fab2769e0b5c0c1c10" }
101-
agentkit-task-manager = { git = "https://github.com/danielkov/agentkit.git", rev = "1204e2b31d77ca820c9302fab2769e0b5c0c1c10" }
102-
agentkit-tool-compose = { git = "https://github.com/danielkov/agentkit.git", rev = "1204e2b31d77ca820c9302fab2769e0b5c0c1c10" }
103-
agentkit-tools-core = { git = "https://github.com/danielkov/agentkit.git", rev = "1204e2b31d77ca820c9302fab2769e0b5c0c1c10" }
90+
agentkit-acp = { git = "https://github.com/danielkov/agentkit.git", rev = "eba802525e718223aa011788559e291267a96473" }
91+
agentkit-adapter-completions = { git = "https://github.com/danielkov/agentkit.git", rev = "eba802525e718223aa011788559e291267a96473" }
92+
agentkit-core = { git = "https://github.com/danielkov/agentkit.git", rev = "eba802525e718223aa011788559e291267a96473" }
93+
agentkit-context = { git = "https://github.com/danielkov/agentkit.git", rev = "eba802525e718223aa011788559e291267a96473" }
94+
agentkit-compaction = { git = "https://github.com/danielkov/agentkit.git", rev = "eba802525e718223aa011788559e291267a96473" }
95+
agentkit-loop = { git = "https://github.com/danielkov/agentkit.git", rev = "eba802525e718223aa011788559e291267a96473" }
96+
agentkit-mcp = { git = "https://github.com/danielkov/agentkit.git", rev = "eba802525e718223aa011788559e291267a96473" }
97+
agentkit-http = { git = "https://github.com/danielkov/agentkit.git", rev = "eba802525e718223aa011788559e291267a96473" }
98+
agentkit-plugins = { git = "https://github.com/danielkov/agentkit.git", rev = "eba802525e718223aa011788559e291267a96473" }
99+
agentkit-provider-openai = { git = "https://github.com/danielkov/agentkit.git", rev = "eba802525e718223aa011788559e291267a96473" }
100+
agentkit-provider-openrouter = { git = "https://github.com/danielkov/agentkit.git", rev = "eba802525e718223aa011788559e291267a96473" }
101+
agentkit-task-manager = { git = "https://github.com/danielkov/agentkit.git", rev = "eba802525e718223aa011788559e291267a96473" }
102+
agentkit-tool-compose = { git = "https://github.com/danielkov/agentkit.git", rev = "eba802525e718223aa011788559e291267a96473" }
103+
agentkit-tools-core = { git = "https://github.com/danielkov/agentkit.git", rev = "eba802525e718223aa011788559e291267a96473" }
104104
agent-client-protocol = { git = "https://github.com/danielkov/rust-sdk.git", rev = "2f039993d1d6ed8da35b38c31f54a7cbb7338c70" }
105105
agent-client-protocol-http = { git = "https://github.com/danielkov/rust-sdk.git", rev = "2f039993d1d6ed8da35b38c31f54a7cbb7338c70" }

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,15 @@ credential_dir = "~/.kit/credentials"
254254
mcp_config = "~/.kit/mcp.json"
255255
otel_endpoint = "http://localhost:4317"
256256

257+
# Optional: explicit retry/time-out policy for the selected provider.
258+
[resilience]
259+
max_retries = 5
260+
retry_budget_ms = 60000
261+
attempt_timeout_ms = 30000
262+
stream_idle_timeout_ms = 30000
263+
initial_backoff_ms = 200
264+
max_backoff_ms = 10000
265+
257266
[acp.claude]
258267
command = "npx"
259268
args = ["-y", "@agentclientprotocol/claude-agent-acp@0.69.0"]

docs/user/getting-started-and-configuration.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,22 @@ url = "https://example.com/plugin.tar.gz"
191191
sha256 = "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
192192
```
193193

194-
`root`, `provider`, `model`, and credential settings apply to all four runtime commands. Subagent model aliases and explicit-override allowlists are scoped by fully qualified harness under `[subagent.harnesses."acp.name"]`. Omitting `allow_model_overrides` permits all explicit model selections accepted by that harness; an empty list disables explicit model overrides. This policy does not restrict the harness's inherited or default model.
194+
`root`, `provider`, `model`, and credential settings apply to all four runtime commands.
195+
The optional `[resilience]` table applies one AgentKit retry and timeout policy to whichever provider is selected, including providers selected later with `/model` and built-in `acp.kit` children. Duration names include their units. The two timeout fields can be omitted to disable those timeouts; the other fields are required:
196+
197+
```toml
198+
[resilience]
199+
max_retries = 5
200+
retry_budget_ms = 60000
201+
attempt_timeout_ms = 30000 # omit to disable the per-attempt timeout
202+
stream_idle_timeout_ms = 30000 # omit to disable the stream-idle timeout
203+
initial_backoff_ms = 200
204+
max_backoff_ms = 10000
205+
```
206+
207+
Without this table, OpenRouter and Speakeasy remain single-attempt. OpenAI subscription retains Kit's built-in long-running policy: a 24-hour request budget, 10-minute attempt timeout, 5-minute stream-idle timeout, 60-second maximum exponential backoff, and 10-minute maximum server-directed retry delay. Invalid zero budgets/timeouts, unknown fields, and a maximum backoff smaller than the initial backoff fail configuration loading without rewriting the file.
208+
209+
Subagent model aliases and explicit-override allowlists are scoped by fully qualified harness under `[subagent.harnesses."acp.name"]`. Omitting `allow_model_overrides` permits all explicit model selections accepted by that harness; an empty list disables explicit model overrides. This policy does not restrict the harness's inherited or default model.
195210

196211
`a2a` applies to `serve` and `tui`. Configured plugins can provide MCP servers without `mcp_config`; supported `stdio` and `streamable-http` declarations are registered, while `sse` declarations are skipped with a stderr diagnostic. If `mcp_config` is also set, its same-named entries override plugin servers, and live removal of an override restores the plugin server. Plugin data is stored under `<config-directory>/plugin-data/<plugin-manifest-name>`. See [Agent Plugins](agent-plugins.md) for placeholders, collision rules, and ACP child behavior. `otel_endpoint` enables OTLP/gRPC export of AgentKit's GenAI trace spans. Use a collector endpoint such as `http://localhost:4317` without a `/v1/traces` suffix. `credential_store` selects one backend for OpenAI, Speakeasy, and MCP and defaults to `memory`; selecting `file` requires `credential_dir`, while a credential directory is invalid with `memory` or `keychain`. Memory credentials are process-local and are not shared with the TUI server process or nested Kit children. Standalone OpenAI and Speakeasy login requires persistent `keychain` or `file` storage. ACP profiles are direct executable-and-argument configurations, not shell command strings. `[subagent].harness` must name an available fully qualified profile such as `acp.review`; otherwise startup reports `unknown subagent ACP harness`. When no subagent harness is selected, the built-in `acp.kit` profile is used.
197212

0 commit comments

Comments
 (0)