Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ What is stable today:
- Antigravity can be launched through the unattended `agy --print` route.
- Antigravity receives a narrow task handoff and reports back through a tiny
report-only MCP server.
- `agy --print` stdout is diagnostic only. Planner/tool-call streams may exit
successfully with empty stdout, so the closed-loop completion signal is the
report MCP or result file marker. When local `agy` drops stdout but records the
response in its conversation database, Dev Triangle can recover the completion
marker from `%USERPROFILE%\.gemini\antigravity-cli\conversations`.
- The local ledger records jobs, handoffs, statuses, result paths, and notes.
- CI validates the MCP protocol on Windows and Ubuntu without needing real
Jules or Antigravity credentials.
Expand All @@ -60,6 +65,13 @@ What is intentionally not claimed:
- This does not store Jules secrets for you.
- The older Antigravity IDE chat launch path can open a UI, but the stable
unattended path is `agy --print`.
- Do not hard-code an Antigravity model label unless it has been verified on the
local machine. If `ANTIGRAVITY_AGY_MODEL` is unset, Dev Triangle lets `agy`
choose its own default model.
- Dev Triangle ignores the legacy unsafe `Gemini 3.5 Flash (Medium)` value even
if it is inherited from the parent process environment.
- New installs should not set `ANTIGRAVITY_AGY_MODEL` by default. Leave model
choice to `agy` unless a local model label has been verified on that machine.
- CI uses deterministic fake worker paths. Real local Antigravity validation is
covered by `scripts/demo-user-flow.ps1` on a machine with `agy` installed.

Expand Down
1 change: 0 additions & 1 deletion config/codex.config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,4 @@ ANTIGRAVITY_HANDOFF_DIR = "C:\\Users\\you\\.dev-triangle\\antigravity-handoffs"
ANTIGRAVITY_EXECUTION_STYLE = "auto"
ANTIGRAVITY_CHAT_MODE = "agent"
ANTIGRAVITY_WINDOW_MODE = "new"
ANTIGRAVITY_AGY_MODEL = "Gemini 3.5 Flash (Medium)"
ANTIGRAVITY_AGY_PRINT_TIMEOUT = "30m"
31 changes: 31 additions & 0 deletions docs/TOOL_REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,22 @@ On many Windows installs, the resolved path is:

Use this before trying to run a real handoff.

Optional diagnostics:

- `smokePrint`: runs a short `agy --print` smoke.
- `smokeTimeoutSec`: timeout for that smoke.

The smoke is diagnostic. Some Antigravity planner/tool-call streams can exit
with empty stdout, so a failed print smoke does not mean `agy` is missing; it
means headless completion capture needs the result mailbox/report MCP path.
If the environment contains the legacy unsafe `Gemini 3.5 Flash (Medium)`
model value, Dev Triangle ignores it and reports that through `agyModelNote`.
When stdout is empty but the model response is stored in the Antigravity
conversation SQLite database, Dev Triangle checks the recent databases under
`%USERPROFILE%\.gemini\antigravity-cli\conversations` and can mark the smoke
passed from that fallback. Set `ANTIGRAVITY_AGY_CONVERSATION_DIR` only when a
test or custom install stores those databases elsewhere.

### `run_antigravity_handoff`

Runs a prepared handoff through Antigravity CLI.
Expand All @@ -253,11 +269,21 @@ Useful options:
- `dryRun`: builds the command without launching Antigravity.
- `waitForResult`: waits for the closed-loop result.
- `resultTimeoutSec`: how long to wait for the result marker.
- `emptyStdoutResultGraceSec`: short grace wait when `agy --print` exits 0 with
empty stdout and no result file.
- `pollIntervalSec`: how often to check for the result.

The command is considered fully complete when the result path is ready and the
marker is present.

If `agy --print` exits 0 but stdout is empty and no result appears, the handoff
is marked `DEGRADED_NO_RESULT`. Treat stdout as diagnostic only; use
`complete_dev_triangle_handoff` or the result marker as the completion signal.
Before returning `DEGRADED_NO_RESULT`, Dev Triangle also checks recent
Antigravity conversation databases for `DEV_TRIANGLE_RESULT_READY`. If the
marker is found in a non-user response step, the server writes the recovered
content to the result path and marks the handoff `COMPLETED`.

### `antigravity_get_result`

Reads or waits for an Antigravity result file.
Expand All @@ -282,6 +308,11 @@ reachability, and Antigravity CLI detection.

Use this as the first diagnostic tool.

Optional diagnostics:

- `includeAntigravityPrintSmoke`: run the `agy --print` smoke.
- `antigravitySmokeTimeoutSec`: timeout for that smoke.

### `job_list`

Lists local jobs and handoffs from the ledger.
Expand Down
35 changes: 35 additions & 0 deletions docs/TROUBLESHOOTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ worker still fails, inspect the worker-specific section below.
| `prepare_jules_repo` is blocked | Secret-looking files, dirty repo, or missing confirmation | Read `safety.blockingFindings`, commit/ignore/remove risky files, then rerun |
| `agy` not found | Antigravity CLI is missing or not on PATH | Install Antigravity CLI or set `ANTIGRAVITY_COMMAND` |
| Handoff stuck at `AWAITING_RESULT` | Worker launched but did not submit a report | Check result path, result marker, and Antigravity output |
| Handoff returns `DEGRADED_NO_RESULT` | `agy --print` exited 0 with empty stdout, no result file, and no recoverable marker in the Antigravity conversation DB | Check report MCP config, result path permissions, and avoid unverified model labels |
| Result file exists but is not ready | Missing `DEV_TRIANGLE_RESULT_READY` marker | Have the worker submit through `complete_dev_triangle_handoff` |
| Smoke test passes but real demo fails | Protocol is healthy, real CLI/auth/model path is not | Run `doctor.ps1`, then test `agy --version` and the demo again |
| CI passes but local worker fails | CI uses fake worker paths | Use `demo-user-flow.ps1` for real local validation |
Expand Down Expand Up @@ -171,6 +172,40 @@ Then run:
.\scripts\doctor.ps1
```

### `agy --print` exits 0 but stdout is empty

This can happen even when Antigravity authenticated and hit the model stream.
The CLI may emit planner or tool-call events without a final printable response.
Dev Triangle therefore treats stdout as diagnostic only; a handoff is complete
only when `complete_dev_triangle_handoff` is called or the result file contains
`DEV_TRIANGLE_RESULT_READY`.

Common causes:

- The worker did not submit through `dev-triangle-report`.
- The result file was not written under the allowed result directory.
- `ANTIGRAVITY_AGY_MODEL` names a model label that is not available locally.
- The agent spent the run planning or calling tools and never produced a final
report.

Fixes:

- Leave `ANTIGRAVITY_AGY_MODEL` unset unless you have verified the exact local
label.
- Dev Triangle ignores the legacy unsafe `Gemini 3.5 Flash (Medium)` value even
when a parent process still has it in the environment.
- Run `mcp_health_check` with `includeAntigravityPrintSmoke=true` when you need
to diagnose headless output.
- Prefer the report-only MCP path: `complete_dev_triangle_handoff`.
- If stdout is empty and no result file appears, Dev Triangle checks recent
Antigravity conversation SQLite databases for `DEV_TRIANGLE_RESULT_READY`.
Only when the mailbox and database fallback both fail should it report
`DEGRADED_NO_RESULT`.
- If `agy` keeps selecting an unavailable or stale model, open Antigravity once,
switch the model in the visible selector, and leave `ANTIGRAVITY_AGY_MODEL`
unset. Do not encode a model label in Codex config or install templates unless
it has just been verified locally.

## Handoff Stuck At `AWAITING_RESULT`

This means Dev Triangle MCP created or launched the handoff, but Codex has not
Expand Down
6 changes: 6 additions & 0 deletions docs/USER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ sequenceDiagram
MCP->>AG: agy --print with handoff prompt
AG->>Report: complete_dev_triangle_handoff
Report->>Ledger: write result markdown + update status
AG-->>MCP: stdout may be empty
MCP->>Ledger: recover marker from Antigravity conversation DB if needed
Codex->>MCP: antigravity_get_result
MCP->>Codex: status, result path, report content
Codex->>User: final explanation
Expand Down Expand Up @@ -289,6 +291,10 @@ Then check the result directory:
If a handoff is stuck at `AWAITING_RESULT`, the worker launched but did not
write the result marker. See [Troubleshooting](TROUBLESHOOTING.md).

If `agy --print` exits with empty stdout, do not treat stdout as the source of
truth. The handoff is complete only when the report MCP, result file marker, or
recoverable Antigravity conversation DB marker proves completion.

## Human Expectations

Dev Triangle MCP is a coordination layer. It should make the workflow easier to
Expand Down
1 change: 0 additions & 1 deletion scripts/install-local.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ ANTIGRAVITY_COMMAND = '$AgyPath'
ANTIGRAVITY_EXECUTION_STYLE = "auto"
ANTIGRAVITY_CHAT_MODE = "agent"
ANTIGRAVITY_WINDOW_MODE = "new"
ANTIGRAVITY_AGY_MODEL = "Gemini 3.5 Flash (Medium)"
ANTIGRAVITY_AGY_PRINT_TIMEOUT = "30m"
"@

Expand Down
Loading
Loading