Skip to content

HostSpark v0.4.2

Choose a tag to compare

@gemini960114 gemini960114 released this 03 Sep 15:15
· 11 commits to main since this release

HostSpark v0.4.2

A feature release adding per-chat project directories, simplified model/effort
selection, and a fix for /cancel (and every other command) being blocked while
a task is running. All 124 tests pass.

New: named project directories via /new [name]

Every chat previously ran agy from an anonymous, auto-assigned
workspaces/chat-{chat_id} folder with no way to see or choose it, and /new
only reset the conversation.

  • /new <name> creates-or-selects a single-segment directory under
    AGY_WORKSPACE_ROOT (confined via a new validate_project_dir_name()
    allowlist plus the existing safe_join() path-traversal guard) and uses it
    as the chat's working directory going forward, replacing the anonymous
    folder. Picking a project also starts a fresh conversation.
  • /new with no argument lists existing project directories as buttons
    (current one checkmarked), mirroring the /model picker. The button
    callback validates the name too, not just the typed-argument path.
  • /clear is decoupled from /new and keeps the old "just reset the
    conversation, keep the working directory" behavior.
  • Switching to a genuinely different project directory also clears any
    /add_dir entries from the previous one -- those are absolute paths with
    no per-project scoping and would otherwise silently keep granting agy
    access to a now-unrelated project.
  • Chats that never call /new are completely unaffected.
  • New .env vars: AGY_DEFAULT_PROJECT_DIR (pre-seeds one directory, default
    initial, so the picker isn't empty on a fresh install). AGY_WORKSPACE_ROOT
    is reused as the parent directory /new is confined to.

Two bugs were found and fixed while building this, both confirmed by tracing
a real conversation transcript and testing the agy binary directly:

  • agy doesn't recognize a directory as its "Active Workspace" just because
    the subprocess cwd points at it
    -- without --add-dir <dir> it silently
    falls back to its own internal scratch location
    (~/.gemini/antigravity-cli/scratch) regardless of cwd. run_agy() now
    always passes --add-dir for whatever directory it resolves.
  • /new and /clear weren't actually starting a fresh agy session.
    HostSpark never persisted a conversation_id back from agy's replies, so it
    was already None on every ordinary turn -- meaning every message fell
    through to the --continue branch regardless of what /new//clear had
    just reset, silently resuming agy's own last session from whatever
    directory that was. Fixed with a one-shot in-memory marker that suppresses
    --continue/--conversation for exactly the next turn after a switch or
    /clear, kept deliberately separate from the pre-existing, sticky
    /new_project on|off toggle so that manual setting can't be broken by it
    (caught by a dedicated regression test before shipping).

New: simplified model + effort selection

  • /model used to list every model x effort combination as separate
    suffixed buttons (gemini-3.8-flash-high, -medium, -low, ...). It now
    lists just the 3 base model names, with /effort (now with its own
    low/medium/high inline picker, not just a typed argument) controlling
    reasoning depth independently.
  • These base names have no unsuffixed form in agy's own model catalog, so a
    new resolve_model_and_effort_args() recombines them into the real
    --model value agy expects (e.g. gemini-3.8-flash + medium ->
    --model gemini-3.8-flash-medium) instead of sending --model/--effort
    separately, which agy rejects as conflicting.
  • Both pickers mark the chat's current selection with a checkmark, including
    normalizing legacy stored values from before this change.

New: reorganized quick-action keyboard (3-3-2 layout)

[ /status ]   [ /model ]   [ /effort ]
[ /session ]  [ /new ]     [ /clear ]
[      /schedule_list      ]  [ /cancel ]

Fixed: /cancel (and everything else) could be blocked for a task's entire duration

python-telegram-bot processes one update at a time by default, and the
message handler blocked on the job's completion after enqueueing it. Sending
/cancel while a long task was running would sit undelivered until that task
finished on its own -- by which point there was nothing left to cancel.
Enabled concurrent_updates and stopped the handler from blocking; the queue
worker already reports back via the status message on its own.

Security

AGY_WORKSPACE_ROOT/AGY_WORKDIR previously defaulted to the entire home
directory when left blank, which is also the boundary used for attachment
uploads, /add_dir, and auto-detected output media. If you haven't already,
point both at a dedicated directory (e.g. /home/ubuntu/projects) rather
than leaving them blank.

Upgrade notes

  • chat_state.db gains a workspace_dir column via an idempotent migration
    that runs automatically on startup (guarded by a PRAGMA table_info
    check, so it's safe to restart repeatedly). Verified against a snapshot of
    a live database before release; back up chat_state.db before upgrading
    as a precaution regardless.
  • Re-run ./install.sh to pick up the new package version and restart the
    service.
  • If AGY_WORKSPACE_ROOT/AGY_WORKDIR are still blank in your .env,
    create a dedicated directory and set both before relying on /new --
    the target directory must already exist or the service will fail to start.
  • Existing chats keep using their old anonymous working directory until they
    run /new themselves; nothing is migrated automatically.