Conversation
## What Several improvements to the Ark bash agent: configurable skillsets via allowlist, debug view upgrades, and graceful task cancellation on server shutdown. ## Why The bash agent was loading all skills indiscriminately, the debug view was trimming thoughts and hiding function call details, and background agent tasks survived server restarts/shutdowns. ## Changes ### Skill loading - **[NEW] `skill_loader.py`** — shared skill loader with `load_skills(include=[...])` allowlist and `copy_skills_to_work_dir(transform=...)` for path rewriting - **`main.py`** — bash agent uses `include=["teacher"]`, UI agent loads all skills - **`journey_router.py`** — delegates to shared loader - **`skilled_agent.py`** — added `skills_dir` parameter to `run_skilled_agent` and `_build_skill_instruction` so meta-instruction paths are caller-configurable (defaults to `/mnt/skills`) ### Debug view (`debug-bash.html`) - Full thoughts (removed 200-char truncation) - Full bash output (removed 500-char truncation) - Function calls in collapsible `<details>/<summary>` twisties showing args and results - Non-bash function results now emitted (previously only bash stdout was shown) - Run list panel showing all `out/*` runs with objective, status, progress bar, and artifact links - Active work area (log) positioned above run list; newest runs shown first ### Task lifecycle - `Run.task` field tracks the `asyncio.Task` handle - FastAPI `lifespan` shutdown handler cancels all running agent tasks - `_run_bash_agent` catches `CancelledError` and emits clean termination event - **[NEW] `test_shutdown.py`** — 3 tests for cancellation scenarios ## Testing - `pytest tests/` in `spikes/ark/backend` — 46 tests pass - Manual: run an agent, Ctrl+C the server, verify the task stops
📊 Coverage Report
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Several improvements to the Ark bash agent: configurable skillsets via allowlist, debug view upgrades, and graceful task cancellation on server shutdown.
Why
The bash agent was loading all skills indiscriminately, the debug view was trimming thoughts and hiding function call details, and background agent tasks survived server restarts/shutdowns.
Changes
Skill loading
skill_loader.py— shared skill loader withload_skills(include=[...])allowlist andcopy_skills_to_work_dir(transform=...)for path rewritingmain.py— bash agent usesinclude=["teacher"], UI agent loads all skillsjourney_router.py— delegates to shared loaderskilled_agent.py— addedskills_dirparameter torun_skilled_agentand_build_skill_instructionso meta-instruction paths are caller-configurable (defaults to/mnt/skills)Debug view (
debug-bash.html)<details>/<summary>twisties showing args and resultsout/*runs with objective, status, progress bar, and artifact linksTask lifecycle
Run.taskfield tracks theasyncio.Taskhandlelifespanshutdown handler cancels all running agent tasks_run_bash_agentcatchesCancelledErrorand emits clean termination eventtest_shutdown.py— 3 tests for cancellation scenariosTesting
pytest tests/inspikes/ark/backend— 46 tests pass