Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ Sub-agents (`subagent_spawn`, `task_*`, `subagent_plan_execute`, `task_history_l

**Loop hardening:** top-level **`doom_loop_enabled`** in `config.toml` (default true) enables ml-intern-style detection of repeated identical tool calls before each LLM step; a corrective **user** message is persisted when triggered (`src/agent/doom_loop.rs`). Independently, the pure controller in `src/agent/budget.rs` tracks LLM turns, wall time, provider-reported tokens, provider retries, context recoveries, repeated typed tool root causes, and observable progress. It emits run-scoped typed warnings, stops three consecutive failures with the same `(tool, error code)` as `Stuck::RepeatedRootCause`, stops sustained no-progress runs as `Stuck::NoProgress`, and retains `max_iterations` only as the absolute LLM-turn ceiling. Steering and context recovery reset no-progress only; successful new evidence may also clear the repeated-root-cause streak, while consumed time/tokens/retries are never refunded.

**Run-scoped LLM providers:** `AgentLogic` keeps the active provider and its credentials behind one lock and snapshots that pair, plus the filtered failover candidates, when a run is admitted. Active runs and already-admitted FIFO items never read process-global provider state. A `/model` switch atomically changes the pair for subsequent admissions; an inbound accepted after the switch keeps the new pair even when it waits behind an older run. Sub-agents use the same snapshot contract. Embedders that need failover candidates use `AgentLogic::new_with_fallback_providers`; `AgentLogic::new` remains the compatibility path with no candidates.

### Structured LLM Extraction
If you are asking the LLM to yield a structured JSON payload internally (e.g. for reflection or summarization outside of the standard `ToolCall` registry):
**DO NOT** use brittle string matching like `text.find('{')`.
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ model_name = "claude-sonnet-4-6"

Use `/model` in the TUI to open the interactive model selector, or `/model gemini-2-5-flash` to switch directly. Your choice is remembered across restarts.

Provider selection is isolated per accepted run. Switching models does not alter an in-flight run; messages accepted after the switch use the new provider and credentials even if they wait in that chat's FIFO. Configured failover candidates are also snapshotted per run, so concurrent chats cannot overwrite one another's fallback policy.

### Skill management

isanagent supports installing specialized **skills** (structured procedures and instructions) from remote GitHub repositories. You can install an entire repository of skills or a specific one using shorthand `owner/repo` or full URLs.
Expand Down Expand Up @@ -155,4 +157,4 @@ cargo clippy --release -p isanagent --all-targets
cargo test --release -p isanagent
```

On Windows, prefer **`--release`** for builds and tests if debug linking hits PDB issues.
On Windows, prefer **`--release`** for builds and tests if debug linking hits PDB issues.
12 changes: 12 additions & 0 deletions docs/public-api-surface.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,15 @@ Constructor: `pub fn new(db_path: &str) -> Result<Self, String>` [src/memory.rs:

The central reasoning actor. All fields private. Constructed via `pub fn new(params: AgentLogicParams) -> Self` [src/agent/mod.rs:1073](../src/agent/mod.rs#L1073). Implements `ActorLogic<BusMessage>` at [src/agent/mod.rs:1270](../src/agent/mod.rs#L1270).

Provider configuration changes must use
`switch_provider_with_credentials(provider, credentials)` so the provider and
the credential identity become visible in one write. The older
`switch_provider(provider)` and `set_provider_credentials(credentials)` methods
remain source-compatible migration shims: the former clears credential identity
and disables fallback for later admissions, while the latter rebuilds a standard
provider from the supplied credentials. Custom provider embedders must migrate
to the paired method. No supported API exposes a mutable credential handle.

> **Overhaul touchpoint.** PR-5 adds a pub method `trigger_compaction(chat_id, options)` to this struct.

### 6.2 `AgentLogicParams` — struct [src/agent/mod.rs:999](../src/agent/mod.rs#L999)
Expand All @@ -293,6 +302,7 @@ Constructor params for `AgentLogic::new`. **All fields `pub`** — embedding cra
pub struct AgentLogicParams {
pub name: String,
pub provider: Box<dyn Provider>,
pub provider_credentials: ProviderCredentials,
pub session_manager: SessionManager,
pub tools: ToolRegistry,
pub skills: SkillRegistry,
Expand All @@ -315,6 +325,8 @@ pub struct AgentLogicParams {
}
```

`AgentLogic::new(params)` preserves the compatibility path with no failover candidates. Embedding crates that configure failover use `AgentLogic::new_with_fallback_providers(params, candidates)`. The candidate vector is owned by that `AgentLogic`; every admitted main-agent or sub-agent run snapshots its provider, credential identity, and filtered fallbacks. Runtime model switches therefore affect only later admissions.

**This struct is on the critical compatibility path.** Adding fields here is breaking without `#[non_exhaustive]` because constructors enumerate every field. Phase 0.0b must add the marker and document the workaround (use struct-update syntax with a default).

### 6.3 `SubagentHarnessParams` — struct [src/agent/mod.rs:1032](../src/agent/mod.rs#L1032)
Expand Down
Loading
Loading