Skip to content
Merged
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
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -669,15 +669,26 @@ let test_steps := conc.ask(test_actor, Execute(test_task))
used to hardcode one — implement `list.zip`, in four fixed phases, with its
own sequential runner — and now drives the same agent graph the TUI does.

This entry point needs the same `--max-steps` override the Quickstart's
`bin/lex-code` wrapper supplies for the TUI, and for the same reason: it's
trusted, long-running orchestration code, not the untrusted-sandboxed-snippet
case the VM's 10,000,000-step default guards against. There's no wrapper
script for this entry point, so it has to be typed by hand every time —
reproduced live: a real multi-module build ran for 17+ minutes across dozens
of agent turns and hit `step limit exceeded` with the flag omitted, discarding
that whole run's output (`bootstrap/run.lex`'s own step-by-step printing only
happens after the graph run returns, so a mid-run panic here loses everything,
not just the final result).

```sh
# the original demo, unchanged
lex run --allow-effects … src/bootstrap/run.lex main
lex run --max-steps 20000000000 --allow-effects … src/bootstrap/run.lex main

# a real task, phases of your choosing
LEX_TASK="add a retry wrapper to src/http.lex" \
LEX_PIPELINE=build,test \
LEX_PROVIDER=litellm \
lex run --allow-effects … src/bootstrap/run.lex main
lex run --max-steps 20000000000 --allow-effects … src/bootstrap/run.lex main
```

| Variable | Default | Meaning |
Expand Down Expand Up @@ -706,7 +717,7 @@ verified_on = [] # "<path>:<kind>" — a pass on that path

```sh
LEX_TASK_SPEC=examples/tasks/zip.task \
lex run --allow-effects … src/bootstrap/run.lex main
lex run --max-steps 20000000000 --allow-effects … src/bootstrap/run.lex main
```

The spec's `goal` becomes the task the agents are told, so the words they act
Expand Down
29 changes: 29 additions & 0 deletions bin/lex-code-bootstrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env sh
# Wrapper for `src/bootstrap/run.lex main` — requires `lex` CLI on PATH.
#
# Same reason `bin/lex-code` exists for the TUI: the VM's default step
# budget (10,000,000, a DoS guard for *untrusted* sandboxed snippets per
# `lex run --help`) kills a long agentic session outright with a
# step-limit-exceeded panic once enough turns or verbose-enough model
# output accumulate. bootstrap/run.lex's own build/test/verify pipeline
# is exactly this case — trusted, long-running orchestration code, not
# an untrusted snippet — and it has no wrapper of its own, so the flag
# has to be remembered by hand every time `lex run` is typed directly.
# Reproduced live, repeatedly: real multi-module builds running 10-20+
# minutes across dozens of agent turns hit `step limit exceeded` with
# the flag omitted, discarding that whole run's output (bootstrap/run.lex
# only prints per-step output after the graph run returns, so a mid-run
# panic here loses everything, not just the final result — see the
# README's "Bootstrap Script" section for the full story).
#
# bootstrap/run.lex's `main` takes no positional args (LEX_TASK,
# LEX_TASK_SPEC, LEX_PIPELINE, LEX_PROVIDER are all read from the
# environment, not argv — see its own header comment for why), so unlike
# bin/lex-code there is no `main --` separator or "$@" forwarding to get
# right here; just the effect grant and the step-limit override.
set -e
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
LEX_CODE_EFFECTS="${LEX_CODE_EFFECTS:-approval,concurrent,crypto,env,fs_read,fs_walk,fs_write,io,llm,net,proc,random,sql,stream,time}"
LEX_CODE_MAX_STEPS="${LEX_CODE_MAX_STEPS:-20000000000}"
exec lex run --max-steps "$LEX_CODE_MAX_STEPS" --allow-effects "$LEX_CODE_EFFECTS" \
"$SCRIPT_DIR/../src/bootstrap/run.lex" main
Loading