Agent loop state machine refactor, unified LLM interface, and UI improvements

- Rewrite agent loop as Planning→Executing(N)→Completed state machine with
  per-step context isolation to prevent token explosion
- Split tools and prompts by phase (planning vs execution)
- Add advance_step/save_memo tools for step transitions and cross-step memory
- Unify LLM interface: remove duplicate types, single chat_with_tools path
- Add UTF-8 safe truncation (truncate_str) to prevent panics on Chinese text
- Extract CreateForm component, add auto-scroll to execution log
- Add report generation with app access URL, non-blocking title generation
- Add timer system, file serving, app proxy, exec module
- Update Dockerfile with uv, deployment config

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-28 22:35:33 +00:00
parent e2d5a6a7eb
commit 2df4e12d30
31 changed files with 3924 additions and 571 deletions

View File

@@ -7,12 +7,12 @@ OCI_HOST="oci"
OCI_DIR="~/src/tori"
IMAGE="registry.oci.euphon.net/tori:latest"
echo "==> Syncing config.yaml to OCI..."
rsync -az config.yaml "${OCI_HOST}:${OCI_DIR}/config.yaml"
echo "==> Syncing project to OCI..."
rsync -az --exclude target --exclude node_modules --exclude .git --exclude web/dist . "${OCI_HOST}:${OCI_DIR}/"
echo "==> Pushing code to OCI..."
git push origin main
ssh "$OCI_HOST" "cd $OCI_DIR && git pull"
echo "==> Building Rust binary on OCI..."
ssh "$OCI_HOST" "source ~/.cargo/env && cd $OCI_DIR && \
cargo build --release --target aarch64-unknown-linux-musl"
echo "==> Building and deploying on OCI..."
ssh "$OCI_HOST" "cd $OCI_DIR && \