Commit graph

78 commits

Author SHA1 Message Date
Darkatse
48aa5c7242 refactor(agent): remove round and tool call budgets
Remove the profile limits, runtime counters, quota errors, and extra-round resume flow. Keep tool authorization stateless and give protocol drift recovery its own 20-attempt limit, reset on resume.

Migrate profiles to schema 5 and discard retired fields at the existing profile, draft, and checkpoint decoding boundaries. Route shared Session profile migration and persistence through AgentProfileService.

Validation: pnpm run check; focused profile and runtime tests; macOS profile migration, JSON save, export dialog, and old checkpoint reads.
2026-10-22 01:48:30 -04:00
Darkatse
1c6cd23ac5 refactor(agent): simplify image and capture handling
Use resource identity for thumbnail state and distinguish stale refs from unexpected errors. Append image diagnostics before deciding whether MCP results are empty, and reuse shared role, media and workspace helpers.

Use the capture filter's geometry consistently, share mobile plugin transport, and remove redundant state, error variants and test assertions. Update the API and architecture documentation to match.

Validation: pnpm run check; focused frontend, Gemini, MCP, image and byte-stream tests; Android debug APK build.
2026-10-22 00:57:47 -04:00
Darkatse
974c1e0028 fix(agent): unify tool image storage and result projection
Store incoming images and rejection notes through one entry point, then project MCP results without duplicating structured text or describing image-only results as empty. Centralize stored image formats and file paths, reuse workspace text reads, and remove superseded identity checks.

Preserve Claude tool images and original text with or without current tool definitions. Route OpenAI-compatible tool media once and reject unsupported Gemini tool audio/video. Document capability, normalization and retention at their owning topics.

Validation: payload, gateway, runtime, MCP, image and Shell focused tests; Rust crate boundaries; pnpm run check.
2026-10-22 00:25:40 -04:00
Darkatse
0f52bf8dac feat(in-app-agent): show tool result images in the Transcript
Read tool image files through a bounded binary workspace API that shares path handling with text reads. Load thumbnails only while tool details are expanded, use the recorded MIME type, and release object URLs on unmount.

Validation: assistant UI tests 10/10 and Agent API contracts 28/28 passed; TypeScript, frontend guardrails, lint, crate boundary and diff checks passed. Shared Rust read path compiled with host MCP contracts.
2026-10-21 22:24:37 -04:00
Darkatse
8cba66db41 feat(agent): let tool results carry images
Normalize extension tool images once into workspace files, keep only references in history, and hydrate a request copy before model retries. Carry the admitted image capability through invocation binding and Session compaction, count retained images, and encode tool images in each provider format. Consolidate tool result construction and redact inline media by structure.

Validation: extension runtime contracts 4/4; agent tools 18/18; tool results 5/5; provider image encoding 4/4; HTTP classification and log redaction focused tests; extension JS contracts 3/3; TypeScript, frontend guards, lint and crate boundaries passed.
2026-10-21 22:21:05 -04:00
Darkatse
793dcdc757 feat(in-app-agent): add manual compaction and context usage meter
Let idle Sessions compact through the existing runtime flow without adding a user message or requesting a reply. Publish runtime context measurements in Run events and show their share of the compaction point in the composer, with an action to compact immediately.

Share Session admission and observation between sending and compaction, retain observed runs that write no message, and update API contracts, translations and behavioral coverage.

Validation: pnpm run check.
2026-10-21 20:57:37 -04:00
Darkatse
bc084ea3c7 fix(agent): converge Review-2 admission, bridges and provider errors
Address Review-2. Admit a prompt snapshot once and carry the parsed request
forward; the host round trip builds its own scope. Active Runs report the seq
their activation starts after, so restored bridges skip a resumed Run's earlier
terminal event. Session prepare returns its assembly request directly, start
always records the generation intent, and one builder serves every assembly.

Count tool calls with the encoder's alias rule, pair the compaction trigger
with its count, and rename the limits errors after contextLimits. Classify only
the provider's error value, including the nested error of a Responses
WebSocket event. Claude reports every non-refusal stop. Drop frontend Session
counting, repeated guards and fallbacks on values that are always present, and
document each fact once at its owner.

Validation: pnpm run check (browser 78, contracts 429, UI, Rust, clippy).
2026-10-21 20:24:42 -04:00
Darkatse
b35609380d refactor(agent): centralize context counting and prompt snapshot construction
Address Review-1 §2. Keep Session counting in Rust and pass each round's count
into compaction. Separate retained-group selection, summary generation and the
recording flow; reuse the decoded response text and avoid cloning Session state.
Group root invocation startup inputs and drop a redundant transport reset.

Build canonical snapshot metadata once as contextLimits. Share current-prompt
payload preparation while retaining the live extension event before conversion.
Localize the compaction row and use the application's locale and entry animation.

Validation: 43 host Agent contracts; frontend types; 28 API tests; 2 browser suites; 9 assistant UI tests; frontend guardrails/lint; crate boundaries.
2026-10-21 19:06:13 -04:00
Darkatse
c654cc6082 feat(agent): compact a Session's context into a summary the model writes
Use preset token budgets and provider usage to compact Session context at the
point or once after a context overflow. Append the summary to canonical history,
retain whole recent groups, and rebuild through the frozen PromptManager request
before continuing the original round. Keep full history for macros and the UI.

Restore active Session assembly bridges from bootstrap after APP_READY, so page
reloads resume pending assembly and Web Host startup makes no native Session call.
Show compaction progress and a folded summary in the assistant transcript.

Validation: pnpm run check; focused Session/storage/provider tests; Web Host startup tests; real Gemini compaction on desktop, Android and iOS; desktop reload, prompt layout/macros, next-send context and context_full checks.
2026-10-21 18:24:05 -04:00
Darkatse
7830065445 fix(assistant): time a Session run from its creation
The assistant read a Run's start from a `run_started` event that the
backend never emits; it records `run_created`. The status strip therefore
never showed elapsed time, and the transcript fell back to the first
loaded message, which is late once a long run spans several pages.

Session run handles now carry the run record's `createdAt`. The status
strip and the current run's bar use it, and the controller keeps it for
the same run after the terminal refresh drops the handle. Runs that ended
before the page opened still use their loaded messages. The event journal
docs now name `run_created`.

Validation: pnpm run check; in-app-agent tests after the terminal-refresh
follow-up.
2026-10-19 02:05:56 -04:00
Darkatse
0ee1233a47 fix(agent): assemble every invocation from the run input
Sub-agents and handoff targets bound to the current chat preset skipped
PromptManager: they received only their instructions and the task, and
inherited the root's sampling, model and Skill scope. The run input was
also trimmed by the root profile before it was frozen, so their own
context policy could not apply.

Generate() now collects unprojected material before the live assembly
and seals it after the hooks (frozen input schemaVersion 2), keeping
World Info, examples and Author's Note additions by source. A single
projection applies each profile's history window and World Info choice;
the live root uses it too and writes its World Info injections back for
{{outlet}}. The World Info scan no longer rewrites the global Author's
Note; Generate() composes it.

Every delegated invocation now requests host assembly through one preset
resolver: the current preset comes from the capture, a named preset from
the repository. Only a root bound to the current preset reuses its live
generation. The run's preset Skill scope is the captured chat preset,
and legacy `none` bindings read as currentPromptSnapshot.

Fixes #328.

Validation: pnpm run check.
2026-10-14 20:58:35 -04:00
Darkatse
32bd1cbb05 feat(macros): unify contextual evaluation and parameter templates
Capture Agent inputs after extension hooks and share MacroEnv across prompt and request templates. Remove frozen macro emulation while preserving live extension behavior.

Simplify live data reads and browser test discovery; document the public context APIs.

Validation: pnpm run check.
2026-09-27 18:25:44 -04:00
Darkatse
a9240512ec fix(agent): continue after extension tool timeouts
Return timeouts as tool errors so the model can inspect state and continue. Retain cooperative cancellation and warn that the operation may still be running.
2026-09-23 20:21:20 -04:00
Darkatse
cbda79fa23 feat(agent): manage persistent sessions and their lifecycle 2026-09-22 13:40:05 -04:00
Darkatse
b102f57139 feat(agent): stream replies with canonical session origins
Carry assistant text and reasoning through the shared live projection and persist session invocation/round identity for preview reconciliation. Update writing consumers and suppress in-flight event delivery after unsubscribe.
2026-09-22 04:24:31 -04:00
Darkatse
4260e7293e feat(agent): support extension tools across chat and sessions
Register WebView tools through a dedicated provider with shared tool selection, naming, and result handling. Keep extension availability independent from saved profile selections.

Clarify model-facing feedback and consolidate behavioral tests and architecture documentation.
2026-09-22 00:55:32 -04:00
Darkatse
3c4d7db117 feat(agent): add persistent session runtime
Add standalone sessions with a shared profile, continuous JSONL history, and persistent work/tmp directories. Reuse frontend preset assembly and the existing model/tool loop with explicit Chat and Session targets.

Validation: pnpm run check
2026-09-21 22:18:25 -04:00
Darkatse
8d12ac646c docs(agent): describe unified workspace capabilities
Document skill mounts, prompt catalogs and migration boundaries. Retain the JavaScript capability and kit references while removing obsolete executor details.
2026-09-20 19:59:31 -04:00
Darkatse
b6d0bbe5ee feat(agent): add slash command for output revisions
Route /fix through the existing resume lifecycle and revise the last reply's selected swipe from its current saved text. Preserve manual edits, support command cancellation, and keep persistent metadata on the bound message.
2026-09-08 03:09:22 -04:00
Darkatse
2a52de78f1 feat(agent): resume chats and retry presentation saves 2026-09-08 01:45:04 -04:00
Darkatse
8e3f51a7c4 feat(agent): stream reasoning in the run timeline 2026-09-06 22:05:03 -04:00
Darkatse
a996402de7 docs(agent): simplify and consolidate framework documentation 2026-09-06 20:53:05 -04:00
Darkatse
f16ad7bff0 feat(agent): show structured delegation and handoff details 2026-09-06 19:14:53 -04:00
Darkatse
14d0f10a15 fix(agent): hide automatic commits from timeline 2026-09-06 17:18:33 -04:00
Darkatse
402ef9bd75 fix(agent): preserve persistent state across chat forks (#216) 2026-09-04 20:11:37 -04:00
Darkatse
76b8b72a84 feat(agent): stream OpenAI Responses tool calls 2026-08-28 18:55:23 -04:00
Darkatse
c8d88663e2 feat(agent): support OpenAI-compatible tool-call streaming 2026-08-28 04:01:27 -04:00
Darkatse
a0bfd3a6b4 docs(agent): document live tool-call streaming 2026-08-28 02:35:43 -04:00
Darkatse
c3f8b3ee1b feat(mcp): add registration-level tool description overrides 2026-08-25 01:14:40 -04:00
Darkatse
605ae1b7fd refactor(agent): commit live workspace without checkpoints 2026-08-18 16:20:05 -04:00
Darkatse
a14070488c feat(agent): auto-commit text drafts before explicit commits 2026-08-13 01:16:57 -04:00
Darkatse
735409dff0 refactor(agent): present tool results as text and Markdown 2026-08-12 20:51:14 -04:00
Darkatse
4af6b0784a refactor(agent): hide internal tool result metadata from models 2026-08-12 18:50:48 -04:00
Darkatse
3a6c93a203 refactor(agent): standardize recoverable line-based reads 2026-08-12 17:49:30 -04:00
Darkatse
206acdeaa7 feat(mcp): add tool execution to legacy generation 2026-08-10 00:19:16 -04:00
Darkatse
be58e1c3e6 feat(agent): add MCP tool execution 2026-08-09 19:40:11 -04:00
Darkatse
40159b499e refactor(agent): make canonical tool descriptors the source of truth 2026-08-04 20:07:20 -04:00
Darkatse
a16f1d2f56 refactor(chat): remove windowed mode and restore full-history semantics 2026-07-19 20:57:41 -04:00
Darkatse
c1ab8d7fcf refactor(chat): converge windowed payload patch contract 2026-07-10 21:24:54 -04:00
Darkatse
91df880813 fix(agent): apply legacy output cleanup before chat commits #114 2026-06-30 16:17:47 -04:00
Darkatse
c62d23deb0 feat(agent): add in-run user guidance steering 2026-06-19 00:19:17 +08:00
Darkatse
5068a6b85b feat(agent): surface model turn narration in run timeline 2026-06-17 00:20:35 +08:00
Darkatse
ad6d5e50dd feat(agent): add automatic run retention cleanup 2026-06-14 23:45:46 +08:00
Darkatse
fe107710bb feat(agent): apply run retention pruning from the history panel 2026-06-14 14:00:36 +08:00
Darkatse
6bdaa330e3 feat(agent): add run retention controls and refactor timeline detail components 2026-06-14 13:02:36 +08:00
Darkatse
13e4cc5d04 feat(agent): add run retention planning and storage classification 2026-06-14 01:29:03 +08:00
Darkatse
17c263f67f feat(agent): add run history listing summaries 2026-06-13 23:56:40 +08:00
Darkatse
1e894f52b5 fix(agent): prune persistent states only from explicit deletion candidates 2026-06-07 22:36:08 +08:00
Darkatse
a1392c7b67 feat(agent): unify multi-agent timeline projection and invocation-scoped event reads 2026-06-07 21:28:21 +08:00
Darkatse
15d278a723 feat(agent): add handoff-aware run timeline projection and UI 2026-06-07 00:34:11 +08:00