Skip to content

Stop button trigger debug - #407

Closed
RooberSmoth wants to merge 34 commits into
mainfrom
stop-button-trigger-debug
Closed

Stop button trigger debug#407
RooberSmoth wants to merge 34 commits into
mainfrom
stop-button-trigger-debug

Conversation

@RooberSmoth

Copy link
Copy Markdown
Collaborator

I'm making a new branch:
Triggers must be cleaned/terminated upon pressing stop.
The run stop system message should appear AFTER all actions are completed and executed (like the info still being sent error, the run stopped message should appear AFTER it?)

CURRENTLY STILL WORKING ON IT.

namabeeru and others added 30 commits July 3, 2026 12:16
Signed-off-by: namabeeru <github.body594@passmail.com>
Signed-off-by: namabeeru <github.body594@passmail.com>
Replace per-call os.walk with a cached filename index and watchdog updates while keeping existing path semantics and output shape.
Fix find_files slowness with SQLite FindIndex (#354):

## What
- Rewrote file_index.py to actually work and stay fast: fixed a crash that made `find_files` completely non-functional (a NameError from a helper defined outside the sandboxed action function), replaced the always-full-rewalk update path with targeted per-changed-file updates (with a directory-rename/process-restart safety net so nothing really goes silently stale), and bulk-loads the index on the initial crawl
- Added multi-root / whole-device search: all_drives, |-joined base_directory, and an optional limit, so one find_files call can cover multiple drives instead of one call per drive, plus a boot-time background pre-warm so the index is usually already warm before a user's first search.
- Made the index cross-platform-safe and easy to clean up: centralized all index storage under CraftBot's own app-data directory (app/data/.file_index/, keyed by a hash of the searched root) instead of scattering .craftbot folders into whatever directory got searched, and added filesystem-boundary detection so indexing / on macOS/Linux can't recurse into /proc, /sys, or other mounted volumes.
Also: fixed an unrelated pre-existing bug where the update-checker (app/updater.py) spawned visible console windows on Windows every time the Settings page loaded.

## Why
find_files/the file-search index (issue #354) had never actually worked when invoked as a real action as it crashed instantly, and once that was fixed, several rounds of testing surfaced further correctness and performance issues (a treadmill of unnecessary full re-scans, an unguarded mount-crossing risk on non-Windows platforms, and index files scattered across the user's drives in a way that's both hard to clean up and unsafe in containerized deployments). This PR makes `find_files` reliably fast, cross-platform, and self-contained.

Closes #354

## How to test
- Restart CraftBot. All of these fixes are in long-running process state and won't take effect until the process reloads.
- Ask the agent to find a specific file by name in a small folder; confirm it returns correctly and much faster than previously.
- Ask for a broad pattern across both a Windows C:/D: (or, on macOS/Linux, root /) in one request via all_drives=true or a |-joined base_directory; confirm one call returns the combined, deduplicated results instead of requiring one call per drive.
- Confirm storage location: after a search, check app/data/.file_index/ exists and contains the index, and that no .craftbot folder appears inside whatever directory was searched.
- Pass limit=0 and a positive limit (e.g. limit=5) on a broad search; confirm 0 returns the full result set (not just one match) and a positive value caps it correctly.
…files

fix/rendering issues for text based files on chat preview and toggle for .md files
Harden launcher preflight and port handling
* New session logic revamp

* UI update for chat session update

* Added end turn action

* remove GUI mode entirely

* session improvement on ui and prompt

* trigger aggregation update

* trigger aggregation update and fix idempotency guard issue, turn it off for now

* Session UI iteration: always-Working live row, chunked activity view, reply-to-bubble, activity restore, title fallback, run-end flicker fix

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Session update

* remove task end action and ui fix

* UI fixes for session revamp

* Fix: requestChatHistory applied message limit per session, correct loading

* Revert "Fix: requestChatHistory applied message limit per session, correct loading"

This reverts commit abf402f.

* fix cached tokens and percentage calculator

* new tokens command and fix on token calculation

* Livingui redesign (#399)

* Living UI V2: replace FastAPI/Vite system with PocketBase + vendored-kit platform

- New standalone living-ui-v2/ workspace: versioned React kit (realtime PB
  hooks, theme packs, console relay), project blueprint, and `lui` CLI
  (create/validate/dev/kit-sync/pb/ops/run/data/verify/probe)
- Validation gate: types, build, migrations-on-fresh-db, ops manifest,
  ownership hashes — with source-annotated errors and a same-error breaker
- walk_verify sub-agent: drives the running app in a real browser
  (playwright MCP) and blocks launch on observed defects (PR #388 contract)
- Manager/actions rewritten for single-process PB apps; V1 template,
  importer, and sidecar removed; ZIP import is deterministic code
- Creation wizard (layout/theme/reference files), option-chip QnA,
  session handoff, spec suite under living-ui-v2/spec/

* Add form and QnA workflow, some UI update

* Theme fix

* Living UI: shadcn-conventional kit APIs + approved npm dependency gate

* living UI building visualizer

* living UI visual update during creation

* separate walk verify + headless browser

* living UI import

* Add more ShadCN compatible UI component

* allow installing any npm

* auth fix

* fix cli issue

* Fix: Hide terminal pop ups

* Fix: Revert dev branch for living ui repo URL

* Fix: Chat panel shows after installing Living UI for the first time

* Fix: Include sessionId in both places that broadcast living_ui_ready

* Fix: Make ensure_project_session() checks non-fatal

* Fix: Assign env vars for callLLM() for Living UIs

* Revert changes Living UI marketplace links

* Error Catalogue revamp. �gent_core/core/errors.py provides new shared error formatting and cataloguing. Add immediate aborting of AUTH/CREDIT/QUOTA/MODEL/BLOCKED/BAD_REQUEST errors instead of silent retries.

* Fix: Ensure no consecutive errors, revert system error changes

* Add A2APP — make agent writes to Living UIs verifiable

An agent asked to "add a todo for tomorrow" wrote due_date: "tomorrow".
PocketBase returned 200, stored an empty string, and the agent told the
user it was scheduled. It had to guess what the app contained, the write
silently failed, and nothing stopped it claiming otherwise.

All three are now handled in the app, so any agent benefits — verified by
driving an app with curl alone, after deleting .superuser.

In the app (new pb_hooks, adapter 1.6.0):
- describe: entities, protocol types, conventions, from the live schema
- identity: PocketBase answers 200 for unknown paths, so an "a2app"
  marker is the only reliable probe
- write guard as router middleware, not a record hook — PocketBase
  coerces first, after which "tomorrow" and "" are indistinguishable
- read-back backstop; errors carry a code and list every violation
- origin guard, agent token, ops auth, rate limits, idempotency

In the CLI:
- reads describe, not PocketBase's superuser-only admin endpoint, so it
  holds no privilege an outside agent lacks
- resolves dates and labels client-side, where a clock and Intl exist
- adapter-sync ships hooks without re-vendoring the kit
- a valueless --flag now errors instead of becoming `true`
- gate rejects e.app inside runInTransaction, which deadlocks the process
  while /api/health still returns 200

In CraftBot:
- the system reports what changed, from the stored record; a false claim
  is withheld and handed back rather than corrected in front of the user
- the data model is inlined into the prompt — three attempts became one
- skills load per run, so operating an app no longer carries the build
  recipe that rebuilt a live app after one row insert
- integration bridge: capability gate, destination allowlist, no redirects

adapter-sync runs at create, install, import and launch — launch is the
only path reaching an app a user already had.

Adds spec/OVERVIEW.md and scripts/a2app-selfcheck.sh (21 checks).

* lint fixes

* Split error messages into two presentation tiers based level of important + Fix Chat persistency

* Fix: Testing and edge case fixes (blocked content error, NoneType crashes)

* Improvement: Sync test between ErrorCategory and ERROR_CATEGORY_STYLE

* Port error catalogue to Provider interfaces (embedding interface, image gen, video gen, factory + plan migration to actions, browser_adapter, CLI commands

* Add the Factory — deterministic build orchestration for weak models

Weak models write code well but manage themselves badly: 26 logged builds,
and every failure was self-management — churning on one dead end, fabricating
causes where evidence was blank, shrinking "email me" into "logs it",
announcing success after failed verification, or quitting unnoticed.
The model keeps the hands; this takes away the clipboard.

- app/factory: stdlib-pure Machine (persisted arc, 3×/12 retry caps,
  escalation, redispatch-on-surrender, honest stuck reports), defect cards
  (cause = quoted evidence or "unknown" — theories unrepresentable), build
  graph as a pure transition (only a parsed PASS reaches done), distiller,
  cookbooks (one generic callAction pattern + dry-run param discovery, email
  as the proven worked example), CraftBot host adapter; layering lint +
  3 test suites incl. replays of two real incidents.
- Fix missions are fresh runs carrying cards; ready/stuck messages are
  machine-composed — agent-authored status is retired.
- Evidence everywhere the platform was silent: gate stderr, response bodies,
  refused-request URLs, boot-log excerpts, handler exceptions, migrate-hang
  kills, pre-boot migration-rename check, CLI error.cause unwrapping.
- Integrations: bridge action endpoint runs CraftBot's own implementations
  (send_gmail, semantic params), grants derived from code by the gate,
  irreversible-confirm + dry-run; omitted `to` = account owner — apps never
  hold identity. Wizard offers marketplace matches; capability map injected.
- Verifier: full spec coverage required, value plausibility, fail-closed
  verdict parsing.

* Removed false claim gate

---------

Co-authored-by: CraftBot <craftbot@craftbot.dev>
Co-authored-by: Tobias Garcia <iguana3000tg@gmail.com>
Co-authored-by: イツミネ <tham_yikfoong@outlook.com>

* expose raw_input in /tokens data

Input is displayed as input - cached, which is lossy; include the
pre-subtraction value for debugging and event consumers.

* Fixed Uneven Ratio Bar, All Ratios add to 100% and Bar Displays Input, Output and Cached

* Fix living UI data update flashing issue

* Fix working status issue

* minor side panel UI update

* show event summarization in chat session

* fix chat session naming issue

* Living UI Workflows + DB Snapshot

* Add force-stop for in-flight runs (#403)

Co-authored-by: CraftBot <craftbot@craftbot.dev>

* CraftBot version on marketplace apps

* Fix whatsapp issue

* Version Change

---------

Co-authored-by: CraftBot <craftbot@craftbot.dev>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Tobias Garcia <iguana3000tg@gmail.com>
Co-authored-by: イツミネ <tham_yikfoong@outlook.com>
Co-authored-by: AlanAAG <alanayalag@gmail.com>
Co-authored-by: RooberSmoth <96537304+RooberSmoth@users.noreply.github.com>
Verifier: turn-budget line each turn, early-end guard (no more turn-8
surrenders), evidence gates for cosmetic/live-data PASSes, full-depth
snapshots.

Factory: thrash-guard defers instead of dropping wakeups (stale-build
fix), stuck arcs re-arm on fresh verify, zero-verified reports can't
deliver, terminal-machine verifies tell the agent to announce.

Chat path: scaffold runs the same interview -> synthesis phase as the
modal wizard, records the origin session, and the delivery FYI now
relays "it's ready" to the requesting chat. New living_ui_usage action
+ 401 recovery hints so chat agents reach the lui CLI instead of
dead-ending. Interview/synthesis prompts refuse impossible data
sources; tabs refetch after baseline restore/staging flip.
Update api key redaction and model switching hanlding
@RooberSmoth RooberSmoth closed this Aug 6, 2026
@RooberSmoth
RooberSmoth deleted the stop-button-trigger-debug branch August 6, 2026 12:57
@RooberSmoth
RooberSmoth restored the stop-button-trigger-debug branch August 6, 2026 12:59
@RooberSmoth
RooberSmoth deleted the stop-button-trigger-debug branch August 6, 2026 13:00
@RooberSmoth
RooberSmoth restored the stop-button-trigger-debug branch August 6, 2026 13:05
@RooberSmoth
RooberSmoth deleted the stop-button-trigger-debug branch August 6, 2026 13:07
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.

8 participants