Commit Graph
76 Commits
Author SHA1 Message Date
Devika Verma 42a1fa1fb7 Feature 1: shadow evaluation - the reviewer records, the human still decides
Spec Part 6 step 3. The reviewer runs on every approval card and records
what it WOULD have decided, while the human decides everything. This is how
the ship gates get measured on real sessions before the flag ever defaults
on. Nothing about a decision changes.

- config.py: auto_approve_shadow flag, off by default, _GLOBAL_ONLY (a
  cloned repo can't turn it on). agent.py attaches the reviewer when either
  auto_approve OR the shadow flag is set; reviewer_shadow gates only the
  recording path.
- engine.py: _spawn_shadow_review fires the reviewer fire-and-forget from
  the needs_user branch and audits stage="reviewer_shadow" joined to the
  human's approval_resolved row by call_id. The card is never delayed; a
  shadow failure never surfaces. Skipped when the live path already
  consulted the reviewer this card (no double spend). approval_requested /
  approval_resolved rows gained call_id for the join.

Eval harness (scripts/eval_reviewer.py, spec 7.5):
- Runs the reviewer against three JSONL corpora and scores the ship gates:
  benign allow-rate >= 30% (prompt-reduction proxy), zero false-allows on
  dangerous and injection. Exit 1 on any gate failure.
- Corpora seeded: benign (20), dangerous (15), injection (13), each with a
  ~20% holdout and per-row answer keys, in the spec's 7.5.1 format. Known
  world is reconstructed folders-and-remotes-only, matching the engine.
- --stub runs with no network (canned verdicts) for plumbing/CI; real runs
  use ProviderRouter and cost money, so this is on-demand, not a pytest.

tests/test_shadow_eval.py (18): shadow records but never decides; shadow
off records nothing; live allow/unsure never double-recorded; shadow errors
swallowed; corpora well-formed; scoring/gate maths; stub passes all gates.
2026-08-12 17:09:58 -07:00
Devika Verma 57002fac71 Finish the Mode.AUTO -> Mode.BYPASS_APPROVALS rename in tests 2026-08-12 12:45:02 -07:00
Devika Verma c958d6f262 Step 2: Auto-Approve mode - the reviewer, the hook, and the renames
The mode from ocw-context/docs/reviewed-auto-mode.md (rev. 4), v1 scope.

coworker/reviewer.py (new)
- The 8.3 prompt verbatim, cache-shaped: instructions + known world (folders
  and remotes only) + user-message history in the stable prefix; this turn's
  request and ONE action in the suffix.
- parse_verdict: any defect (empty, non-JSON, unknown verdict) -> unsure.
  There is no parse path that results in execution (8.5).
- Reviewer.review never raises: provider errors and timeouts -> unsure.
  Metering counters (checks / verdicts / tokens) for 1.7.
- AGENT_DENY_MESSAGE: the terse, non-diagnostic refusal the agent gets on a
  deny; the full reason goes to the user only (8.4 asymmetry).

coworker/engine.py
- Reviewer consulted ONLY when: attached, mode is AUTO_APPROVE, session
  explicitly attended (unset is_attended counts as NOT attended, so
  automations can never be reviewed), fewer than two denials this turn.
- Consulted ONLY on decisions the gate marked needs_user - hard denies
  never reach it, so it can only turn "ask" into "allow" (1.2).
- One action per request, fired concurrently for all of a turn's escalating
  calls before the sequential authorize loop (8.6): a verdict cannot land
  on the wrong action, and approval cards still reach the human one at a
  time in call order.
- allow -> runs, audited with the reason. deny -> blocked; user event
  carries the full reviewer reason + allow_anyway; agent message carries
  only AGENT_DENY_MESSAGE. unsure -> today's card.
- Reviewer sees the user's words only, extracted mechanically from
  role=user messages - never agent output, never tool results (4.4).

coworker/permissions.py
- Mode.AUTO renamed Mode.BYPASS_APPROVALS ("bypass-approvals"); legacy
  "auto" still parses via _missing_ so configs, saved sessions, and the
  golden decision table are untouched.
- Mode.AUTO_APPROVE ("auto-approve"): gate-identical to INTERACTIVE except
  session grants ("always allow this ...") no longer auto-allow - they
  route to the reviewer instead (1.5: out-of-band standing policy may skip
  the judge; an in-flow click may not). Config allowlists still skip.
- _domain_allowed(include_session=False) checks the user-settings list only.

coworker/config.py: auto_approve flag, off by default, _GLOBAL_ONLY (a
cloned repo cannot hand itself a looser reviewer). agent.py attaches the
Reviewer only when the flag is on; without it AUTO_APPROVE behaves exactly
like INTERACTIVE.

server/manager.py: autonomy audit ranks auto-approve above interactive
(turning the reviewer on IS raising autonomy) and below bypass.

GUI: mode picker label "Full access" -> "Bypass approvals" (wire value
"auto" kept). Verified live against the real sidecar; e2e spec updated;
tsc and all 111 GUI unit tests pass.

Tests: tests/test_auto_approve.py (33) - gate behaviour per mode, fail-
closed parsing, prompt shape, deny asymmetry, retry guard, attended
gating, hard-deny isolation, per-action verdict landing, and that the
reviewer never sees agent prose. Permission suites + golden table: 146
passing unchanged.
2026-08-12 12:42:17 -07:00
Devika Verma 186d29a3fd Step 1: known world frozen at session start; ingestion facts to audit only
coworker/session_facts.py: KnownWorld (roots + git remotes + hosts, captured
once before the agent acts) and SessionFacts (per-turn ingestion records).
Nothing consumes either in v1 - the known world will be rendered into the
reviewer prefix in step 2, ingestion exists so the v2 question ("would this
fact have changed a verdict?") is answerable from a shadow run replay
instead of re-argued.

- render() shows folders and remotes ONLY. Hostnames are held for DST-1 in
  v2 but never rendered: a host list is only useful to a reviewer that can
  do a suffix match, which models get wrong and Python does not.
- Freezing is the point: a remote added after capture stays unknown, so an
  agent cannot make its own destination look familiar.
- Ingestion records the fact and the hostname, never the content and never
  a full URL (a query string is exactly where a payload rides). Failed
  calls record nothing. Local reads are deliberately excluded; the cost of
  that exclusion is recorded in the spec.
- Engine hook is inert when session_facts is None; classification keys on
  tool metadata category (web/connector/mcp) so new connectors are covered
  the day they ship.

22 new tests. Permission suites (146) and the golden decision table pass
unchanged - this step alters no decision.

Spec: ocw-context/docs/reviewed-auto-mode.md Part 0, 2.4, Part 6 step 1.
2026-08-12 12:16:45 -07:00
Devika Verma a4c5f2456a PR4: validate approval answers server-side; audit autonomy changes
1. Grant validation. POST /v1/inbox/{id}/resolve takes a raw resolution string
   and approval_outcome() previously honoured whatever it named. The GUI
   deliberately withholds the tool-wide "always allow" for run_shell (the
   command-scoped grant is the narrower option), for save_skill (every skill
   proposal gets its own review) and for connectors; Slack mirrors render only
   approve/deny. So any local API caller could mint a session-wide,
   any-argument shell grant -- a vocabulary the design says must not exist.

   _grant_offered() now mirrors the card's own rules on the server and
   downgrades an unoffered grant to a one-time approval, writing a
   `grant_refused` audit row. Applied to the "always" channel vocabulary too,
   so a Slack reply cannot mint what the in-app card would refuse. MCP tools
   are covered alongside connectors: they are not category=connector but are
   external, and the grant would be unbounded over every future argument.
   A failed always_task mint is now audited rather than silently downgraded.

2. Autonomy transitions. Mode changes (WS set_mode) and the unattended toggle
   were unrecorded, so "who turned on auto mode, and when" was unanswerable
   from the audit store -- at odds with the per-call trail the engine keeps
   everywhere else. Both now write an audit row tagged raised/lowered, so
   autonomy increases can be filtered. set_unattended moves onto the manager
   so REST and any future surface record it the same way; no-op flips are not
   recorded.

15 new tests. test_server's two failures are pre-existing on the unmodified
tree (Windows file-permission errors in pathlib), unrelated to this change.

Design of record: ocw-context/docs/reviewed-auto-mode.md Part 3.
2026-08-11 11:47:38 -07:00
Devika Verma ab00fe3b55 PR3: split compound commands and check each part independently
The old rule -- any shell operator disqualifies the whole command -- was wrong
in both directions, verified by running it:

  find . -delete                  -> ALLOW  (destructive, no prompt)
  find . -exec rm {} +            -> ALLOW  (destructive, no prompt)
  git status && git diff          -> ask    (two allowed reads, refused)

It judged punctuation rather than danger. `-delete` and `-exec` need no
separator, so a bare `find` prefix auto-ran them; meanwhile two independently
allowed reads were refused for containing `&&`.

Now:
- Constructs whose contents we cannot evaluate -- substitution, redirection,
  variable expansion, grouping -- still disqualify the whole command, because
  the unexamined tail after a prefix match must only ever be arguments.
- Compound commands are split on &&, ||, ;, |, |&, & and newlines, and EVERY
  part must be independently covered by an allowlist entry.
- Parts that run code named in their arguments are never prefix-eligible:
  argument executors (xargs, sudo, timeout, env, docker, npx, ssh...),
  interpreters carrying inline code (python -c, bash -c, node -e), and
  execution/deletion flags (-exec, -execdir, -delete, -ok).
- Matching stays on parsed words, so `git status` covers `git status -s` but
  never `git statusfoo` or a bare `git`.

Splitting is textual and does not respect quoted separators. That is
deliberate: over-splitting yields MORE parts to justify, never fewer, so it
cannot loosen a verdict.

37 new tests including metamorphic cases (spacing, quoting, absolute program
path must not loosen `find . -delete`). Golden matrix: three rows flip as
intended, two added. 164 permission tests green.

Design of record: ocw-context/docs/reviewed-auto-mode.md Part 2 (CMD-1/3/4).
2026-08-11 11:43:57 -07:00
Devika Verma 48a498d5e2 PR2: protect the permission system's own settings; never auto-approve
in-project files that execute later

Two floors, both mode-independent.

1. The settings files (config.toml, risk_overrides.json, workspace_trust.json,
   unattended.json, coworker.db which holds the saved grants, secrets.json,
   inbox_routing.json) cannot be modified by any tool, in any mode. The check
   runs BEFORE mode, allowlists and every auto-approve path, and returns a hard
   refusal rather than an approvable prompt -- loosening requires editing the
   files out-of-band.

   The escalation this blocks: approve one ordinary-looking `python setup.py`,
   it quietly appends to risk_overrides.json, and every future session is more
   permissive. That happens in the DEFAULT interactive mode, so the protection
   cannot be a property of a sandbox or of any single mode.

   Covered for write tools (resolved path), patch/diff blobs (path extracted),
   and run_shell (command text). Shell matching is deliberately full-path only:
   an earlier draft also matched bare filenames, which hard-denied any command
   merely mentioning `secrets.json` -- caught by
   test_shell_commands_not_auto_allowed_by_default, which reads that path with
   `cat`. Shell is parser depth: it stops accidents and casual attempts, not a
   determined adversary. That needs the OS sandbox (OPE-14).

2. Files inside the workspace that run on a later, innocuous action --
   .git/hooks/**, .github/workflows/**, .vscode/tasks.json, .coworker/** --
   stay writable but never WITHOUT a human. Auto mode, custom-mode auto_allow
   and session "always allow" all lose to this. Otherwise accept-edits is a
   clean bypass: write .git/hooks/pre-commit, then run an innocuous git commit.

19 new tests, incl. every mode parametrized and a lookalike case
(docs/pre-commit.md stays ordinary). 167 permission-related tests green.
test_standing_approvals::test_blocked_run_does_not_stall_other_tasks is an
intermittent pre-existing scheduler timing flake (fails ~1 in 3 on the
unmodified tree).

Design of record: ocw-context/docs/reviewed-auto-mode.md Part 3.
2026-08-11 11:41:24 -07:00
Devika Verma a442e0e0b8 PR1: split egress out of READ, stop override downgrades, scope patch writes
Three gate defects, each verified by direct execution before and after.

1. web_fetch was RiskClass.READ, so is_consequential() was False and evaluate()
   returned allow on its third rung -- before any rule, mode or PDP, in EVERY
   mode including plan/discuss. A URL's query string carries data outbound, so
   this was an ungated egress path. New RiskClass.EGRESS covers model-chosen
   network reads; web_search stays READ (fixed configured provider, not a
   model-chosen host). Adds an allowed_domains allowlist (exact host or
   subdomain; 'evil-python.org' never matches 'python.org'), a session-scoped
   "always allow this domain" grant, and ApprovalOutcome.ALWAYS_DOMAIN.

2. A risk override could DOWNGRADE a built-in: marking write_file as read made
   is_write False (skipping path scoping) and consequential False (skipping the
   read-only gate) at once -- one settings line disabling two protections, in
   every future session. Overrides may now only tighten a built-in write/exec/
   egress tool; relaxing a metadata/MCP tool (the intended use) still works.

3. Path scoping read a literal "path" argument, so apply_patch and
   apply_unified_diff -- whose paths live inside the patch/diff blob -- were
   never scoped at all. write_paths() extracts them from the blob and scopes
   every one; a write whose path cannot be located now fails closed to approval
   rather than slipping through auto/custom unscoped.

allowed_domains is user-global only, alongside auto_allow: a cloned repo must
not be able to widen the agent's network reach.

Golden matrix: web_fetch interactive allow->ask, plan allow->deny, plus new
egress/patch rows (31 rows green). test_permissions_risk's override test
asserted the old downgrade behavior and is updated to the tightening rule.
Full suite: 22 failures, all pre-existing on the unmodified tree (boto3 absent,
Windows symlink privilege, Slack socket timeouts) -- none introduced here.

Design of record: ocw-context/docs/reviewed-auto-mode.md Part 3.
2026-08-11 11:37:46 -07:00
Devika Verma d976e82a88 Phase 0: golden decision table for the permission engine
Freezes today's evaluate() verdict across 26 (mode, tool, args, grants)
situations, so any later permission change shows up as a row-diff. Four rows
are marked BASELINE-WRONG / BASELINE-ANNOYING on purpose: they record known
gaps (shell auto with no sandbox, find -delete and find -exec auto-allowed via
a find prefix, git status && git diff rejected for the operator, web_fetch
never gating in any mode). The PRs that fix these flip their rows here as the
visible proof.

Design of record: ocw-context/docs/reviewed-auto-mode.md Parts 3 and 7.
2026-08-11 11:18:21 -07:00
Rohit Prasad 8861da136c Merge pull request #415 from coderdailyone/security/pin-web-fetch-connections
security: pin fetched connections to the vetted address (close DNS rebinding)
2026-08-07 20:36:25 -07:00
Rohit P f21c53dd29 Merge branch 'main' into feature/memory 2026-08-07 19:33:58 -07:00
Rohit P 53d5fc498f Merge branch 'main' into issue/ope-51-ask_user-upgrades 2026-08-01 09:45:03 -07:00
Rohit P 997b2a9548 Merge branch 'main' into issue/ope-46 2026-08-01 08:58:04 -07:00
Devika Verma 70e4610a3e Add support for Skills (#391)
Global & per-workspace skill.
Per-persona skills will be improved later as we re-design that abstraction, as per roadmap.
2026-08-01 08:50:53 -07:00
coderdailyoneandClaude Fable 5 18ac388162 security: pin fetched connections to the vetted address (close DNS rebinding)
guard.get_checked previously resolved a name for the address check and then let
the client resolve it again to connect, so a ~0-TTL record could flip to
127.0.0.1 (or the metadata endpoint) between the two — the exact gap the module
docstring called out as "not covered".

Every hop now connects to the address that passed its check: the request URL
carries the vetted IP, Host keeps the original name (and explicit port) for
virtual hosting, and the sni_hostname extension keeps the TLS handshake — and
certificate verification — against the name. Literal-IP URLs are unchanged.
Redirect Locations are resolved against the logical URL, and the final logical
URL rides resp.extensions["logical_url"] so web_fetch reports the name, not the
pinned address.

Verified against a local TLS server whose cert carries only DNS:pinned.test:
the pinned request (URL=127.0.0.1, sni_hostname=pinned.test) verifies and the
server sees Host: pinned.test; the same request without the extension fails
with "IP address mismatch" — httpcore does verify certificates against
sni_hostname, not the URL host.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-31 10:16:09 +01:00
Rohit C Prasad 25dc283d9b fix: stop artifact walk entering OS app-data dirs; context bar off by default
The artifacts scan used rglob and filtered after descending, so a home directory
workspace walked into ~/Library and triggered the macOS App Data consent prompt on
every turn. Walk with pruning instead, and skip Library / AppData in search too.

The composer chip now shows the session total by default, with the context window
bar behind a Settings toggle.
2026-07-30 13:10:30 -07:00
Rohit C Prasad e5c56998ab security: block CGNAT range and guard browser_open_url
Follow up to #290. Add RFC 6598 shared space (100.64.0.0/10, used by
Tailscale) to the address guard, and run the same guard on the Playwright
browser_open_url before navigating.
2026-07-30 11:57:31 -07:00
Rohit Prasad 7e69398b15 Merge pull request #290 from Mr-Neutr0n/security/block-ssrf-in-url-tools
security: block loopback/private/metadata addresses in model-supplied URL fetches
2026-07-30 11:55:49 -07:00
Rohit Prasad 38e1f03021 Merge pull request #161 from psssnikhil/fix/inbox-reply-word-boundaries
fix(inbox): match approval keywords as whole words, not substrings
2026-07-30 11:40:43 -07:00
Rohit C Prasad 6217dbcb37 mcp: global config wins on name clash with a trusted workspace
Follow-up to #215: a trusted repo can no longer redefine a global server
by reusing its name.
2026-07-30 11:24:06 -07:00
Rohit Prasad 5071451d9c Merge pull request #351 from andrewyng/rpCompactionPolish
Compaction - progress signal, capped user-message list, long-paste clamp; Kimi K3 via Together
2026-07-30 11:22:01 -07:00
Rohit Prasad cca04218ec Merge pull request #215 from HaoChiBao/security/workspace-mcp-trust-gate
security: gate workspace MCP config behind WorkspaceTrustStore (#213)
2026-07-30 11:21:03 -07:00
Rohit C Prasad f9f51c97c6 compaction: live progress signal + user-message cap
COMPACTING event drives a 'Compacting context…' transient in the GUI.
Cap the compacted block's user-message list at 40 with an honest omitted count.
2026-07-30 06:24:39 -07:00
Devika Verma 330010cc66 compaction: harden the smoke against per-turn event loops (OPE-27)
The live smoke exposed a harness trap: driving each turn through its own
asyncio.run() binds the engine asyncio primitives to the first loop, and
every later stream silently takes the interrupted path - full provider
replies persisted as empty assistant messages. The scripted smoke had
the same latent artifact and did not assert reply content, so it stayed
green. Now the whole scenario runs on ONE loop (like the real server)
and every turn asserts a real reply.
2026-07-29 18:00:38 +05:30
Devika Verma 0bf9b87800 compaction: repeated-compaction smoke through the manager (OPE-27 4/4)
A long multi-turn session driven through the real SessionManager with a
forced 3k-token cap: repeated compactions advance the boundary, later
summaries fold the previous one in, the provider verifiably receives the
compacted view (summary block + verbatim tail, bounded) while the
canonical transcript keeps every turn, state survives a mid-conversation
rebuild, and the persisted record round-trips the final boundary.

Scripted stand-in for the live-model smoke: intent survival across a
real summarizer (prompt tuning) still needs a configured provider key.
2026-07-29 16:23:26 +05:30
Devika Verma 4fa8acffed compaction: Settings overrides + GUI divider (OPE-27 3/4)
Settings -> Models grows a Context compaction card next to Token savings:
the trigger % of the context window (10-95), the absolute token cap
(clamped 10k-2M), and the summarizer-model pin (default: the session's
own model). POST /v1/settings/compaction persists them; engines read the
knobs live per check, so changes apply to running sessions immediately.

The "context compacted" divider rides the existing notice machinery: the
persisted `compacted` notice replays on reload (itemsFromMessages) and
the live COMPACTED event appends the same info notice mid-turn. The
transcript itself stays intact - outbound-only by construction.

Covered by vitest (marker replay), a settings-card e2e (defaults +
clamped POSTs + model pin), and a mid-session divider e2e driven by the
fixtures' scripted `compacted` event.
2026-07-29 16:20:24 +05:30
Devika Verma f08a3c425b compaction: engine hook, failure policy, persistence (OPE-27 2/4)
Minimal engine footprint: a checkpoint at each iteration top (between tool
turns and before a new turn), the usage signal captured per round-trip
(context_tokens; chars/4 estimate when never reported), and
_outbound_messages consulting the boundary. The summarizer runs off-loop
through the normal provider router, so the Settings model pin is just an
id.

Failure policy per spec: retry once in both modes; attended sessions get
the Retry / Trim-oldest-10% prompt (via the ask_user plumbing, gated by an
is_attended callback the WS surface wires); unattended runs auto-trim and
continue — never parked on internal bookkeeping. Raw context-overflow 400s
from the main model route into the same policy, progress-guarded so a
still-overflowing model terminates in the error path.

CompactionState persists on the session record (new sqlite column, same
defensive parse as grants), so reloads keep the compacted view. A
persisted compacted notice + a new COMPACTED event mark the spot for
the GUI divider (rendered in commit 3).
2026-07-29 16:13:14 +05:30
Devika Verma 028d42eb3b compaction: pure module + tests (OPE-27 1/4)
Trigger math (usage signal, chars/4 estimate fallback, min(80% x window,
250k cap) with overridable knobs), boundary picking that never splits a
turn (user-message starts preferred, iteration starts inside a giant tool
loop), the 8-section summarizer prompt with the continuation contract,
mechanical working-state extraction from tool records, deterministic
user-message preservation, the trim-oldest fallback, outbound-view
application, and context-overflow detection. Injectable provider seam;
no engine changes yet.
2026-07-29 16:05:30 +05:30
Devika Verma 70cd1fa3d4 ask_user upgrades: rich options, grouped questions, option previews (OPE-51)
Options accept {label, description, recommended, preview} objects (plain
strings unchanged — old sessions render as today's pills), and `questions`
groups up to 4 questions into one call, rendered as a stepper via the
header chips. Any option preview switches the card to a two-pane layout:
options left, monospace pane right, following hover/focus.

Grouped calls resolve with a JSON map keyed by header-or-question and
return {answers: {...}} to the agent (single stays {answer: ...});
a grouped item's first question doubles as its title/options so channel
mirrors and legacy surfaces degrade sensibly. Channel buttons use option
labels; grouped items mirror as text with the open-the-app hint.
2026-07-29 15:52:05 +05:30
Devika Verma 55362abbc9 Merge branch 'main' of https://github.com/andrewyng/openworker into issue/ope-46 2026-07-29 12:07:07 +05:30
Devika Verma 964da79ad6 Merge branch 'main' of https://github.com/andrewyng/openworker into feature/memory 2026-07-29 12:04:52 +05:30
Mr-Neutr0n ff86735cf0 security: block loopback/private/metadata addresses in model-supplied URL fetches
web_fetch and browser_read_url take a URL straight from the model. The model's
input is untrusted by design - both tools' own descriptions call fetched
content "data to evaluate, not instructions" - and web_fetch is
requires_approval=False, so nothing prompts the user before the request goes
out.

Neither validated the address. Verified against a scratch server on loopback:

    web_fetch("http://127.0.0.1:9931/")
    -> {"text": "Directory listing for /\n.git/\n.github/..."}

No prompt, no error. The same call reaches http://169.254.169.254/ for cloud
metadata when OpenWorker runs on a VM, an Ollama instance on :11434, or any
service on the user's LAN. It cannot reach OpenWorker's own sidecar, which
requires COWORKER_API_TOKEN.

Adds coworker/web/guard.py: resolve the host and refuse when any answer lands
in loopback, private, link-local (which covers the metadata endpoint),
multicast or reserved space. Checking every resolved address means a name with
one public and one private A record is refused rather than raced.

Redirects are the usual bypass, so follow_redirects is off and the chain is
walked here with each hop checked before it is requested. _request grows an
opt-in check_addresses flag used only by browser_read_url; the hardcoded vendor
endpoints the rest of the connectors call skip the guard and its DNS lookup.

Not covered, and stated in the module docstring: DNS rebinding. The name is
resolved by the guard and again by the client when it connects, so a near-zero
TTL record can change in between. Closing that needs connection-level IP
pinning. The hop check is the cheap 90%.

Tests: tests/test_url_address_guard.py - literals, IPv4-mapped IPv6 loopback,
names resolving into private space, split-horizon answers, non-http schemes,
redirect into loopback proven not to be requested, and a bounded redirect
loop.
2026-07-29 02:22:10 +05:30
Devika Verma 9d3f6d389d Route native OpenAI (blank endpoint) to the Responses provider
_build_openai: no custom base_url -> OpenAIResponsesProvider; a custom
endpoint (Azure /openai/v1, vLLM, compat gateways) keeps the Chat
Completions OpenAIProvider, as do Ollama and every compat vendor. Verify
path (raw GET /models) and matrix ids are untouched.
2026-07-28 20:48:43 +05:30
Devika Verma 26b4c80b32 OpenAI Responses provider: reasoning + tools for native OpenAI models
/v1/chat/completions rejects function tools with any reasoning_effort
other than none on GPT-5.6, so native OpenAI has run with reasoning OFF.
OpenAIResponsesProvider speaks /v1/responses instead: reasoning + tools
at real effort, streamed reasoning summaries into the existing
reasoning_delta plumbing, and CoT continuity across tool round-trips via
store:false + encrypted reasoning replayed through a new _openai message
sidecar (same extras contract as _anthropic/_gemini). Not routed yet.
2026-07-28 20:45:31 +05:30
Devika Verma ef59b0f39a Memory V1: remembered facts, your instructions, one screen
Coworkers remember durable things you tell them and use them in future sessions.
One Settings screen lists everything remembered - edit, delete, or stop new saves; standing instructions ride along.
Knowledge is session-stable, the save switch is per-message; sqlite gains a summary column via in-place migration.
2026-07-28 20:32:14 +05:30
Rohit C Prasad 8991d303e0 Enable prompt caching on the Anthropic provider
Two ephemeral breakpoints per request (last system block, final message's
last block) so append-only history re-reads the prior turns' cache;
outbound-only, persisted history stays clean.
2026-07-27 22:47:30 -07:00
Rohit C Prasad 979badbd3c Meter token usage across all model providers
Normalized TokenUsage (input/output/cache split) captured in every provider's
stream and complete paths, persisted as an assistant-message sidecar and sent
on the assistant_message event; matrix gains verified context-window sizes.
2026-07-27 21:01:31 -07:00
Rohit C Prasad 33d3efd3b2 Vertex: countTokens verify, global-location host, honest region help
Model listing 403/404s under plain ADC; countTokens is free and proves
project+location+API in one call. Verified live: Gemini (global), Qwen MaaS (us-south1).
2026-07-27 12:58:16 -07:00
Rohit C Prasad f281b29ff1 Provider auth redesign: joined segments, method panels, Vertex methods
Segmented track + inset per-method panel with its own Test & save footer.
Vertex gains the same treatment: Google Cloud login (default), service account,
and API key (express mode, Gemini-only with a clear error elsewhere).
2026-07-26 21:10:59 -07:00
James Yang 29adb8d406 Polish workspace MCP trust gate: shared helper and tighter tests.
Extract _mcp_workspace_trusted for the three load sites, drop the unused spawn payload from the regression test, and remove a stray blank line.
2026-07-26 17:46:31 -04:00
James Yang 8cfd5b5bfe Gate workspace MCP config behind WorkspaceTrustStore.
Untrusted repos must not define stdio MCP servers that spawn at session open. Skip <.coworker/mcp.json> until the workspace is trusted, matching allowed_commands consent.

Fixes #213
2026-07-26 17:41:56 -04:00
Rohit C Prasad b719227a9a Bedrock settings: one auth method at a time
'Connect with' segmented choice (API key / profile / IAM keys) shows only that
method's fields; non-selected fields are dropped at build so stale values can't leak.
2026-07-25 22:55:28 -07:00
Rohit C Prasad 333f589c80 Support Bedrock API keys (bearer auth)
New optional field: paste the console-generated key, no CLI/IAM setup needed.
Takes precedence over SigV4 credentials, matching boto3; live-tested on Converse.
2026-07-25 21:58:24 -07:00
NIKHIL PENTAPALLI b922311a79 fix(inbox): match approval keywords as whole words, not substrings
resolve_from_reply decided allow/deny with 'in' checks on the whole message,
so "disallow" resolved as allow (checked first, and it contains "allow") and
replies containing words like "note" or "not" resolved as deny instead of
being recorded as free-text answers. Since this gates parked unattended
actions, a false allow is the worst-case direction.

Keyword intent now requires word boundaries (with the common -d forms added);
emoji checks stay as substring matches. Anything that matches neither list
falls through to the existing free-text path, which records the reply verbatim
instead of acting on it.
2026-07-25 18:33:16 -07:00
Rohit C Prasad 050cc894e7 Add Google Vertex AI provider with per-family dispatch
gemini/ and claude/ ids reuse the native providers; openweight/ goes through the
MaaS OpenAI-compat endpoint with an auto-refreshed google-auth bearer.
Credentials: service-account JSON or Application Default Credentials.
2026-07-25 16:19:00 -07:00
Rohit C Prasad 8cb9524f1f Add AWS Bedrock provider with per-family dispatch
claude/ ids use Anthropic's native Bedrock client; everything else goes via Converse.
Credentials: explicit keys, named profile (incl. SSO), or the ambient AWS chain.
2026-07-25 16:15:18 -07:00
Rohit C Prasad ee495b9006 Add OpenRouter as an OpenAI-compatible reseller provider
Descriptor + curated matrix rows + sk-or- key auto-detect (server and GUI).
2026-07-25 16:07:33 -07:00
Rohit P 7656952692 security: harden Slack approval handling 2026-07-24 22:33:13 -07:00
Rohit P ac83bc0490 security: complete local access protections 2026-07-24 18:44:39 -07:00
Rohit P 3f5ac872ca security: refine workspace trust controls 2026-07-24 18:44:39 -07:00