Skip to content

Agent readiness: exit codes, --json, diagnostics, build logs - #6

Merged
mkuznets merged 11 commits into
mainfrom
agent-readiness
Oct 10, 2026
Merged

mkuznets merged 11 commits into
mainfrom
agent-readiness

Conversation

@mkuznets

@mkuznets mkuznets commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Makes tx easier for coding agents and scripts to use.

Changes

  • Separate exit codes for usage, auth, config and LaTeX errors. A build timeout counts as a service failure (exit 1).
  • --json on every command. In JSON mode, progress and errors go to stderr, and stdout holds a single JSON document.
  • Detects coding agents and sends a User-Agent. When an agent is detected, --log defaults to file.
  • token delete requires --yes, and flag values are validated.
  • Login works without a browser.
  • LaTeX diagnostics are shown as file:line: severity: message. Build logs are saved to .texops/logs/<doc>.log (--log=file|terminal).
  • Build events are read up to 8 MiB per line. Before this, a large done event made a successful build fail with "token too long".
  • Non-interactive use is documented in help, the man page and the site docs (site/docs/agents.md).

Compatibility

The CLI degrades gracefully against the currently deployed server. Without log_url or diagnostics it falls back to the tail of the streamed output. Without /api/distributions it falls back to the built-in list of TeX Live versions.

The server side is texops/monorepo#3. Deploy it before releasing this.

Testing

go vet, golangci-lint and go test -race ./... pass.

tx status without credentials now reports ResolveAuth's not-authenticated
or session-expired message (C5) instead of the old fixed text (C1); exit
code 3 and the JSON shape are unchanged.
…er edge cases

- token list sizes every column to its widest value
- tx status names TX_API_TOKEN when the server rejects it
- tx token create accepts the name as an argument
- tx without a command is a usage error (exit 2)
- tx build saves a generated project_key only after the project is created
The streamed log goes to stderr, so stdout was a misleading name.
The done event carries the build's diagnostics on one SSE data line, which
could pass bufio.Scanner's default 64 KiB limit and fail a successful
build with "token too long". Lines up to 8 MiB are now read.
The service now also cuts the list to fit its size limit, so truncated
can be set with fewer than 50 diagnostics.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
texops-site 7e15fb4 Oct 09 2026, 11:43 PM

@mkuznets
mkuznets merged commit 9e026ae into main Oct 10, 2026
5 checks passed
@mkuznets
mkuznets deleted the agent-readiness branch October 10, 2026 00:05
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