Repository navigation
fix: delegated runs no longer hang; route workspace questions; real agent and command names (1.1.0) #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: delegated runs no longer hang; route workspace questions; real agent and command names (1.1.0) #7
Changes from all commits
b2a6bf8
13af34b
bebecf5
033a2ee
6d26f1e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,9 +1,9 @@ | ||||||
| --- | ||||||
| description: Delegate a task to altimate-code, the specialised data-engineering CLI agent (warehouse access, column-level lineage, cross-DB, FinOps, query optimization) | ||||||
| description: Delegate a task to altimate-code, the specialised data-engineering CLI agent (warehouse access, column-level lineage, cross-DB, FinOps, query optimization, your Altimate workspace's skills and knowledge) | ||||||
| argument-hint: <task description> | ||||||
| --- | ||||||
|
|
||||||
| The user explicitly invoked `/altimate` to delegate this task to altimate-code. You MUST run the task via the `altimate-code` CLI — do NOT attempt the work with native `Bash`/`Edit`/`Write` tools. | ||||||
| The user explicitly invoked `/altimate-code:altimate` to delegate this task to altimate-code. You MUST run the task via the `altimate-code` CLI — do NOT attempt the work with native `Bash`/`Edit`/`Write` tools, and do not read the project's files first: altimate-code investigates the project itself. | ||||||
|
|
||||||
| Workflow (follow in order, no skipping): | ||||||
|
|
||||||
|
|
@@ -12,57 +12,54 @@ Workflow (follow in order, no skipping): | |||||
| command -v altimate-code | ||||||
| ``` | ||||||
| If it returns nothing, stop and tell the user: | ||||||
| > altimate-code is not installed. Install with `npm install -g altimate-code` (Node 20+), then run `altimate-code` once to configure your provider/warehouse auth, then re-run `/altimate <task>`. | ||||||
| > altimate-code is not installed. Install with `npm install -g altimate-code` (Node 20+), then run `altimate-code` once to configure your provider/warehouse auth, then re-run `/altimate-code:altimate <task>`. | ||||||
|
|
||||||
| 2. **Pick the agent persona** based on the user's task shape. Start cheap and escalate on failure — fast-edit handles most dbt/SQL work at 10–20× lower cost than builder. | ||||||
| 2. **Vague debug** ("X is broken") with no failure named: **stop — ask the user for the specific error before delegating.** | ||||||
|
|
||||||
| | Task shape | Use `--agent` | | ||||||
| |---|---| | ||||||
| | Any dbt / SQL task (rename, refactor, create, debug, structural) | `fast-edit` (default) | | ||||||
| | Aggregation correctness on multi-table joins | `analyst` if fast-edit fails the user's verification | | ||||||
| | Warehouse-state work (lineage, cost, parity, schema diff, PII, FinOps) | `builder` | | ||||||
| | Vague debug ("X is broken") | **Stop — ask the user for the specific error before delegating.** | | ||||||
|
|
||||||
| Decision rule: start with `fast-edit`. Only use `analyst` / `builder` when the cheap path fails for a documented reason. | ||||||
|
|
||||||
| 3. **Run altimate-code with the chosen agent.** Pass `$ARGUMENTS` through a | ||||||
| 3. **Run altimate-code with the `builder` agent**, which has the warehouse tools, workspace skills and memory. Pass `$ARGUMENTS` through a | ||||||
| here-doc into a variable so the shell never command-substitutes anything the | ||||||
| user typed, and write the result to a private `mktemp` file (not a shared | ||||||
| user typed, write the result to a private `mktemp` file (not a shared | ||||||
| `/tmp/altimate-result.md` — concurrent invocations clobber each other and a | ||||||
| world-readable fixed path leaks warehouse rows or PII): | ||||||
| world-readable fixed path leaks warehouse rows or PII), and redirect stdin | ||||||
| from `/dev/null` (`altimate-code run` reads piped stdin as part of the task, | ||||||
| and this shell leaves stdin open): | ||||||
| ```bash | ||||||
| TASK="$(cat <<'ALTIMATE_TASK' | ||||||
| $ARGUMENTS | ||||||
| ALTIMATE_TASK | ||||||
| )" | ||||||
| umask 077 | ||||||
| OUTPUT_FILE="$(mktemp -t altimate-result.XXXXXX.md)" | ||||||
| OUTPUT_FILE="$(mktemp "${TMPDIR:-/tmp}/altimate-result.XXXXXX")" | ||||||
| altimate-code run "$TASK" \ | ||||||
| --agent <fast-edit|analyst|builder> \ | ||||||
| --agent builder \ | ||||||
| --yolo \ | ||||||
| --output "$OUTPUT_FILE" \ | ||||||
| --dir "$(pwd)" | ||||||
| --dir "$(pwd)" \ | ||||||
| < /dev/null | ||||||
| ``` | ||||||
|
|
||||||
| **If this is a follow-up task in the same project** (the user invoked `/altimate` already in this conversation about the same dbt project / warehouse / data context), add `--continue` to resume the warm session — cache is hot, follow-on cost is materially lower: | ||||||
| **If this is a follow-up task in the same project** (the user invoked `/altimate-code:altimate` already in this conversation about the same dbt project / warehouse / data context), add `--continue` to resume the warm session — cache is hot, follow-on cost is materially lower: | ||||||
|
|
||||||
| ```bash | ||||||
| TASK="$(cat <<'ALTIMATE_TASK' | ||||||
| $ARGUMENTS | ||||||
| ALTIMATE_TASK | ||||||
| )" | ||||||
| umask 077 | ||||||
| OUTPUT_FILE="$(mktemp -t altimate-result.XXXXXX.md)" | ||||||
| OUTPUT_FILE="$(mktemp "${TMPDIR:-/tmp}/altimate-result.XXXXXX")" | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. WARNING: Strip any trailing slash on
Suggested change
Reply with
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as the first TMPDIR thread: not changing this. The double slash is harmless, and the suggested expansion is not valid. |
||||||
| altimate-code run "$TASK" \ | ||||||
| --agent <fast-edit|analyst|builder> \ | ||||||
| --agent builder \ | ||||||
| --yolo --output "$OUTPUT_FILE" --dir "$(pwd)" \ | ||||||
| --continue | ||||||
| --continue \ | ||||||
| < /dev/null | ||||||
| ``` | ||||||
|
|
||||||
| Skip `--continue` if the user switched projects, switched debugging threads, or this is the first `/altimate` invocation in the conversation. | ||||||
| Skip `--continue` if the user switched projects, switched debugging threads, or this is the first `/altimate-code:altimate` invocation in the conversation. | ||||||
|
|
||||||
| If the project is linked to an Altimate workspace, altimate-code uses its skills, knowledge and memory automatically. There is nothing to pass. | ||||||
|
|
||||||
| 4. **Surface the result verbatim:** read `"$OUTPUT_FILE"` and present its contents to the user without re-summarising, re-formatting, or commenting. altimate-code has already produced the answer. Delete `"$OUTPUT_FILE"` after presenting so warehouse rows, lineage, or PII findings don't linger on disk. | ||||||
| 4. **Surface the result verbatim:** read `"$OUTPUT_FILE"` and present its contents to the user without re-summarising, re-formatting, or commenting. altimate-code has already produced the answer. Delete `"$OUTPUT_FILE"` after presenting so warehouse rows, lineage, or PII findings don't linger on disk. If the command's stderr says `not in the workspace yet` or `Could not confirm that the memory saved here reached the workspace`, add the matching note from the skill body's failure-modes table after the result. | ||||||
|
|
||||||
| 5. **On any altimate-code error** (`Unauthorized`, `Token limit reached`, `No provider configured`, warehouse credentials wrong, process timeout) — surface the error message to the user along with the fix from the skill body's failure-modes table. Do NOT fall back to native tools. The user invoked `/altimate` specifically to use altimate-code; falling back would defeat the purpose. | ||||||
| 5. **On any altimate-code error** (`Unauthorized`, `Token limit reached`, `No provider configured`, `Not signed in to Altimate`, warehouse credentials wrong, process timeout) — surface the error message to the user along with the fix from the skill body's failure-modes table. Do NOT fall back to native tools. The user invoked `/altimate-code:altimate` specifically to use altimate-code; falling back would defeat the purpose. | ||||||
|
|
||||||
| Task to delegate: $ARGUMENTS | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WARNING:
TMPDIRcommonly has a trailing slash on macOS (e.g./var/folders/.../T/), so${TMPDIR:-/tmp}/altimate-result.XXXXXXexpands with a double slash (//altimate-result...). Strip any trailing slash with${TMPDIR%/}so the path is normalized.Reply with
@kilocode-bot fix itto have Kilo Code address this issue.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not changing this. A double slash in a path is harmless on macOS and Linux; delegated runs in testing wrote to
…/T//altimate-result.XXXXfine. The suggested${TMPDIR%/:-/tmp}is also not valid parameter expansion.