Skip to content

fix(deep-journey): follow the run stream to the end, --no-stream included - #61

Merged
liady merged 3 commits into
mainfrom
fix/journey-hold-stream
Oct 6, 2026
Merged

liady merged 3 commits into
mainfrom
fix/journey-hold-stream

Conversation

@liady

@liady liady commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

What

ax deep-journey --no-stream never finished a run: it waited about 15 minutes, then exited 3 with "still executing". ora saves a journey's final status only from inside the run's stream (GET /api/journey/runs/{id}/stream), and --no-stream only polled GET /api/journey/runs/{id}, so the run stayed running. The CLI now always reads a running journey's stream to its result or error frame. --no-stream now just hides the live trajectory view, so it prints the same final report and exit code as a streamed run.

Why

Only the stream route writes a finished run's status (completeJourneyRun in ora). The fallback for a stream that went quiet had the same problem, because it also switched to polling. ora's own docs said "stream or poll" until eralabs-ai/ora#1266 corrected them.

Changes

  • performDeepJourney streams every running record.
    • A stream that drops or closes before its last frame is reopened up to 5 times, 2s apart. A reopen resumes the same run on ora's side and never re-runs the agent.
    • Polling the detail is now only the last resort, after every reopen fails. The run can still finish then if something else streams it.
    • Streaming and polling share one 15-minute budget, so a run that can't be followed fails at about 15 minutes. Without it, the worst case would have been about 27.
    • A stream 404 or auth error ends the command at once. A 429 waits out its Retry-After, up to 60s, before the next reopen.
  • --no-stream now only suppresses onTrajectory. The flag help and README describe it as hiding the live view.
  • The stream request now sends the partner key when one is set. A recognized key lifts the stream's 20-per-minute per-IP limit for a run that already exists, which reopens depend on.
  • The "still executing" error, and the progress line when polling starts, now name the stream's last failure. The --help text and JSDoc no longer say --no-stream polls.

Checks

  • pnpm lint, pnpm build, pnpm smoke and pnpm verify:pack pass locally.
  • Typecheck and tests pass except in src/tunnel/, which needs the @ora-ai/tunnel-protocol dev dependency. It isn't installed in my checkout, and this PR doesn't touch that code.
  • Tests cover the new behavior:
    • --no-stream still opens the stream and never calls onTrajectory;
    • a stream that closes early is reopened, not polled;
    • the partner key is sent on the stream;
    • polling happens only after 5 reopens;
    • a stream 404 fails fast;
    • a 429's Retry-After is waited out;
    • the 15-minute budget stops both reopening and polling.
    • The test for a run that never settles still ends in "still executing".

…uded

ora saves a journey's terminal status only from inside the stream route.
--no-stream polled GET /api/journey/runs/{id} without ever opening the
stream, so the run stayed "running" and the CLI failed after ~15 minutes
with "still executing". The quiet-stream fallback polled the same way.

The CLI now always streams a running journey, reopening a dropped or
early-closed stream up to five times; a reopen resumes the run without
re-executing the agent. --no-stream only hides the live view. Polling
remains the last resort after every reopen fails. The partner key now
rides on the stream too, which lifts its per-IP limit on reopens.
@liady
liady requested a review from a team as a code owner October 6, 2026 23:09
…treams

From local review. Streaming and polling now share one 15-minute budget:
a run nobody streams cannot finish, so the old 15 minutes of polling after
six silent stream windows only delayed "still executing" to ~27 minutes.

A stream 404 or auth refusal ends the command at once instead of being
reopened and then polled. A 429 waits out its Retry-After (capped at 60s)
before the next reopen. The stream's last failure is now named in the
progress line and the final error, and the --help and JSDoc text no
longer say --no-stream polls.
liady added a commit that referenced this pull request Oct 6, 2026
## What

This regenerates `src/contract/` against contract 1.27.0, which ora.ai
started serving after ora #1278 merged, and moves `BUILT_AGAINST` from
1.26.0 to 1.27.0. Apart from `contractVersion`, only two journey
description strings in the generated types changed: the anonymous per-IP
run limit is now 20 runs per 24 hours, down from 200. No field or shape
changed. The PR also corrects the CLI's own text for that limit: the
`deep-journey` caps line in `--help` and the command output, the
rate-limit error hint, and the README now say 20 runs per IP per 24h,
and the README names the 3,000-a-day anonymous ceiling from ora #1282.
Exit codes are unchanged, and users on this build stop seeing the "newer
contract" stderr advisory. It turns the "Contract drift vs production"
job green again; that job is currently failing on every open PR,
including #61.

## Why

The drift job is the alarm for "ora shipped a contract this build was
not generated against".

## Checks

- [x] `pnpm lint` and `pnpm test:ci` pass locally, except `src/tunnel/`,
whose `@ora-ai/tunnel-protocol` dev dependency isn't installed in my
checkout.
- [ ] Behavior change is covered by a test (or explain why not):
generated types plus help and error text; no logic change.
@liady
liady enabled auto-merge (squash) October 6, 2026 23:34
@liady
liady merged commit 7786337 into main Oct 6, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant