Skip to content

Make limits runaway guards: larger model, code, Codex and repository limits, with model input bounded near 200k tokens - #295

Closed
demegire wants to merge 15 commits into
mainfrom
feat/lenient-limits
Closed

demegire wants to merge 15 commits into
mainfrom
feat/lenient-limits

Conversation

@demegire

@demegire demegire commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Before → after

Area Limit Before After
Model output Default max_output_tokens 4,096 32,000
Keyword screening 5,000 (v6); 8,000 + retry 16,000 (v7) 32,000 + retry 64,000 (v8)
Content plan, style capture, X style, X revise, growth plan, character design, site health 6,000–24,000 32,000
Organic audit, paid ads, keyword seeds/review 2,000–24,000 unchanged
Model time Default provider wait (TIN_LITE_LUNA_TIMEOUT) 90 s 600 s
Code workflows timeout_seconds max / activity 60 s / 4 min 900 s / 20 min
Model calls per run / per route 8 / 4 32 / 16
Route input / output 32 KB (~9k tokens) / 4,096 tokens 256 KB (~70k tokens) / 32,000 tokens
Model input per run none (only call count) soft gate: warning logged past 700 KB (~200k tokens)
Cost estimate 1 token per input byte 1 token per 3 input bytes, every declared call at full size
File read / output / model response 64 KB 1 MB
File calls / bridge calls 64 / 32 256 / 128
Service calls / response / wait 8 / 64 KB / 25 s 32 / 1 MB / 60 s
Codex Contract for new runs v4 session (1.05M context); v1/v3 for non-session work (8–64 requests, 0.1–2M tokens, 4–8k output, 128k context) v5 everywhere: 256k context, compaction at 200k, 128k output; non-session runaway stops at 256 requests / 8M tokens
Root session ceiling (default) $5 $10
Child inside a parent pool $5 $5
Declared sandbox max / design and task default 3,600 s / 900 s 7,200 s / 1,800 s
Compute activities 2 h / 4 h 3 h / 6 h
Repository Files / snapshot / tarball / per file 20,000 / 100 MB / 500 MB / 2 MB 100,000 / 250 MB / 1 GB / 10 MB
Selected-file archive 30 MB / 5,000 files 100 MB / 20,000 files
Content delivery activity 5 min 15 min
Memory Sources / index 200 KB (fail when over) / 100 KB 700 KB each (~200k tokens); older sources dropped
Hosted defaults (new projects) Per run / monthly / scheduled run $10 / $10 / $10 $25 / $100 / $50

Replaces the approach of #274. Limits become runaway guards set well above what production runs use, instead of estimates that stop ordinary runs. Model context stays bounded: no single call over about 200k tokens, and no code-workflow run over about 200k tokens of model input.

Why

Over the last 30 days in production:

  • Limits stopped about 13 runs and cut short several more.
  • Keyword screening stopped at exactly 5,000 output tokens in a59cded8 and de1a4d3e, with 3.5k–4.2k of them reasoning. Six of 27 screening calls reached 90% of the cap.
  • Codex sessions stopped at exactly $5: code map 2c31289d and email shortlist 05a4dfc2.
  • The v3 contract stopped runs at 64 requests (signup walkthrough), at 2M tokens and on 128k-context 413s (product demo).
  • The v1 contract refused competitor.watch and mention_backlinks with 422s.
  • Three repository workflows were refused as too large, and project memory d711b841 failed on "memory sources exceed 200000 bytes".
  • 75 scheduled runs and 4 starts were refused by the $10 hosted defaults.

Actual spend is far below the ceilings: audit at most $0.90, keyword plan at most $0.50, Codex p90 at most $2.30 except the code map. Billing charges verified usage, so the higher limits change worst-case reservations, not what a normal run costs.

Context sizes use the o200k tokenizer: 4.4–4.7 bytes per token on prose, code and JSON, about 3.5 on real workflow evidence. So 256 KB is about 70k tokens and 700 KB about 200k.

What changes

Model output and time

  • The default max_output_tokens goes from 4,096 to 32,000, and the default provider wait from 90 s to 600 s (TIN_LITE_LUNA_TIMEOUT too).
  • Activities wrapping calls that use the default wait get longer timeouts: memory, scan, weekly brief, visibility, answer page, character design, the organic panel, observe and brand steps, and keyword collect.
  • Keyword plan v8 (catalog 0.8.0) screens with a 32,000-token cap and retries once at 64,000. No low reasoning effort. The worst-case run is $2.00, which fits the existing $2 floor. v2–v7 are unchanged.
  • These steps now have a 32,000-token cap, each through its own versioning: content plan (content-editorial-v8), style capture, X style, X revise, growth plan steps, character design and site health.
  • Organic audit, paid ads, keyword seeds and keyword review are left alone. Raising them needs repricing, and none came near its cap in production.
  • Receipts now record max_output_tokens, the provider's stop reason and output_truncated. An empty answer at its cap is labelled output_truncated instead of invalid_result.

Code workflows

  • timeout_seconds maximum 60 → 900 s; the activity's timeout goes from 4 to 20 minutes.
  • Model calls per run go from 8 to 32, and per route from 4 to 16. Per call: 256 KB input and 32,000 output tokens. Package code's model calls now pass the package's timeout to the provider.
  • New soft gate: when a run's model calls pass 700,000 bytes of input in total (about 200k tokens), the call is still sent and Tin logs one warning for the run (run ID, workflow, step, bytes). Each receipt records its input bytes.
  • The worst-case cost assumes 3 bytes per input token instead of 1, for every declared call at full size (largest package on Sol: $17.39, under the new $25 per-run default). Admitted runs keep their pinned terms; a quote issued before deploy returns stale_quote once.
  • File reads, outputs and model responses go from 64 KB to 1 MB. File and bridge calls go from 64 and 32 to 256 and 128.
  • Services allow 32 calls with 1 MB responses. The gateway waits 60 s per call, up from 25; managed Google calls 55 s, custom APIs 50/55 s.

Codex

  • New admissions pin contract v5: a 256k context with compaction from 200k, 128k output per response and 8 MiB requests.
  • Work that isn't session-funded moves from v1/v3 to v5 with runaway stops of 256 requests and 8M tokens. That covers Start here children, parent children, Studio, diagrams, design and tasks.
  • Start here and its approved setup children stay included and Tin-funded through the same path as before.
  • A root Codex run's default ceiling goes from $5 to $10. Children inside a parent pool keep $5, so the traffic system pool is unchanged.
  • The maximum declared sandbox time goes from 3,600 to 7,200 s. The design and task sandbox default goes from 900 to 1,800 s. Compute activities go from 2 h / 4 h to 3 h / 6 h, and proxy grants live up to 7,260 s.
  • A relay rejection's cause is now saved on the attempt receipt as relay_rejection: context_bound, request_limit, token_limit and so on. The run's failure message names it.

Sizes and billing

  • Repository limits: 100,000 files (was 20,000), 250 MB snapshots (was 100 MB), 1 GB tarballs (was 500 MB) and 10 MB per file (was 2 MB).
  • Files a workflow reads out of a snapshot: 100 MB and 20,000 files (was 30 MB and 5,000). Up to 500 files fetched one by one when missing from the tarball.
  • Snapshots are now assembled through temp files instead of in memory. The byte limits are set by the switchboard VM: an e2-small with about 4.7 GB of free disk.
  • Content delivery's activity timeout goes from 5 to 15 minutes.
  • Memory sources and the memory index are both capped at 700 KB, since that text goes into a single model call. Older sources are dropped instead of failing the run.
  • New hosted projects get $25 per run, $100 a month and $50 per scheduled run. Existing saved limits are untouched; credits and Stripe are unchanged.

Deploy notes (not done in this PR)

  1. Rebuild and verify the isolated, browser-API and Studio-API sandbox templates before deploying the switchboard.
    • v5's context settings live in sandbox/codex_api_config.py, and the runtime refuses a v5 procedure unless the image answers --check-v5. Tasks have no such check and fail on an old image before any model call.
    • The new 400,000-entry workspace bound is also in the image.
    • Keep a v4-capable image for runs already pinned to v4.
    • The opt-in live isolation probe has a new bounded_context scenario for checking a rebuilt image.
  2. The forward-proxy host carries its own copy of proxy_grants.py. Reinstall it before any procedure declares more than 3,600 s; none does today.
  3. If /etc/tin-lite/runtime.env sets TIN_LITE_LUNA_TIMEOUT, it overrides the new 600 s default.
  4. The growth plan module's contract digest changes. A growth plan run started before the deploy whose first activity runs after it is refused.

Follow-ups

  • Procedures that don't declare a timeout still get 900 s. That default is written into built-in definitions, so changing it needs per-workflow declarations and version bumps.
  • Organic panel prep, character design and keyword collect have no heartbeat, so a crashed worker now waits up to their longer timeouts (85 min for panel prep) before Temporal retries. These stages should get heartbeats.
  • Organic audit, paid ads and keyword seeds/review caps need repricing before they can rise.
  • Existing hosted projects keep $10 / $10 / $10 until an admin raises them.

Tests

  • Full suite locally, with a disposable Postgres 16 and the Temporal test server: 5,163 passed, 65 skipped.
  • ruff format --check, ruff check, lint-imports, dump_catalog.py --check and validate-community (32/32) pass.
  • New tests cover:
    • keyword plan v8;
    • the soft-gate warning (sent, logged once), and the run-maximum formula;
    • the raised validator maximums and the IPC buffers;
    • a pre-v5 quote being honoured, and a pinned v4 session still running;
    • the relay rejection cause being recorded;
    • the proxy grant lifetime;
    • memory dropping older sources;
    • the new hosted defaults.

🤖 Generated with Claude Code

demegire and others added 14 commits October 2, 2026 17:25
Repository workflows (site.health_improve, product.code_map) failed on the
workspace limits, and content delivery stopped on files over the 2 MB
per-file limit. Raise the runaway guards: 100,000 files (GitHub's recursive
tree truncates there anyway), 250 MB snapshot, 1 GB tarball, 10 MB per file,
500 blob fallbacks; selected-file reads 100 MB / 20,000 files.

The byte bounds are set by the switchboard VM (an e2-small with about 1 GB
of free RAM and under 5 GB of free disk), which every run in flight shares.
The verified files now wait in a temporary file instead of a dict in memory,
so the switchboard only holds the finished compressed archive. The isolated
sandbox's per-root entry bound rises to 400,000 so a 100,000-file snapshot
plus its .git objects fits (needs a template rebuild to take effect).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
project.memory d711b841 failed with "memory sources exceed 200000 bytes".
The sources go whole into one gardener call and the index into later
sessions, so both stay within ~200k tokens: 700,000 bytes. Older sources
that no longer fit are left out instead of failing the run. The bounded
project-file read rises to match the index.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ed run

75 scheduled runs were refused for no sufficient standing limit and four
manual starts for the $10 monthly limit. Only projects without a policy get
the new defaults; saved policies, credits and the welcome grant are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…pshot

A refresh delivery downloads up to a 1 GB tarball and rebuilds a snapshot of
up to 250 MB on the shared-core switchboard before it commits; 5 minutes
could run out for a large repository. Activity timeouts are not part of
replay history, so running workflows replay unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…signals on receipts

Production caps caused failures without saving money: billing charges the
tokens a call actually used, so a cap only decides when a long answer fails.

- ModelRequest.max_output_tokens defaults to 32,000 (was 4,096). Every
  native caller sets its own cap, so no current request or fingerprint
  changes.
- Provider clients wait 600 seconds by default (was 90), and so does
  TIN_LITE_LUNA_TIMEOUT, which also feeds the Responses client. Activities
  that wrap a default wait now outlast it: project memory, scan report and
  weekly brief 12 minutes, visibility audit 35, answer page 25, character
  design 45, organic panel preparation 85, observation 25, brand checks 35,
  and keyword collection 60. Timeout values are not part of replayed
  commands.
- An empty response at its cap, or one the provider says stopped there
  (Anthropic max_tokens, Gemini MAX_TOKENS, OpenRouter length), is
  output_truncated rather than invalid_result when its structured answer is
  empty or unparseable. Plain text at the cap is still returned.
- native_model_usage_v1 and model external_usage_v1 receipts add
  max_output_tokens, stop_reason and output_truncated. The fields are
  additive; pricing reads none of them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v7 is deployed, so it stays as it is. In runs a59cded8 and de1a4d3e the
screening call stopped at exactly 5,000 output tokens after 3.5-4.2k tokens
of reasoning, and v7's 8,000/16,000 caps are sized like answer lengths
rather than runaway guards. New definitions pin keyword-plan-v8 (catalog
organic.keyword_plan 0.8.0): v7 with only the screening caps and their
reservations changed. Batches stay at 50; reasoning effort stays the
model's choice.

- First attempts get 32,000 output tokens and the one retry 64,000, half
  of GPT-6 Luna's 128,000.
- An 80,000-byte request is 84,096 input tokens to the recorder (standard
  band), so the largest first attempt costs $0.0265 and reserves $0.03,
  and the largest retry $0.0425 and reserves $0.045. Six batches and six
  retries reserve $0.45, and a full run at most $2.00: seeds $0.10,
  review $0.15, screening $0.45, 22 lookups $1.10, 40 samples $0.20. The
  $2 floor covers it exactly, so the floor, the catalog default and the
  organic system's keyword limit are unchanged.
- Seeds and review keep their caps; raising either would pass the floor.
- Screening waits up to 600 seconds per call (was 240) for every policy;
  waiting never changes a request.
- v2-v7 stay registered and send exactly what they did.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ning

A cap only decides when a long answer fails; billing charges the tokens a
step used. Runs pinned before keep their caps.

- content.plan 0.9.0 pins content-editorial-v8: v7 with 32,000 output
  tokens (was 16,000). At its bounds a plan costs at most $0.088, still
  under the $0.10 its $1 share in the organic system is sized from.
  Definitions pinned to v7 resolve to v7.
- style.capture 1.3.0 (policy 2, was 6,000), social.x_style 1.2.0 (policy 3,
  was 6,000) and social.x_revise 1.2.0 (x-feedback-v2, was 8,000). Style
  capture and X revisions now accept every policy version they shipped and
  send the pinned cap; contexts saved before keep 6,000. x_style's policy 1
  no longer follows style capture's current cap.
- growth.onboarding_plan steps all use 32,000 (were 6,000-16,000); the
  plan's contract digest changes, as with any change to its module.
- creative.character (was 24,000; four Sol calls at every bound cost about
  $1.73 of its $2 ceiling) and the site-health fix (was 16,000), which pin
  no cap.
- Skipped: the organic audit (its $2 ceiling is computed from 6,000-token
  calls), paid ads (Sol reservations sized from their caps), keyword seeds
  and review (would pass the $2 floor) and code workflows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Production runs kept hitting conservative code-workflow limits (#273's model
wait, the 64 KB read cap worked around in #89, #239, #261, #270). Limits are
now set well above real use, while model context stays bounded per run.

- timeout_seconds max 60 -> 900 (still the package window and each model
  call's wait; the provider now waits as long instead of its 90 s default);
  execute_code_workflow start_to_close 4 -> 20 min, heartbeats unchanged.
- Model routes: 8 -> 32 calls per run, 4 -> 16 per route, max_input_bytes
  32,000 -> 256,000, max_output_tokens 4,096 -> 32,000; response 64,000 ->
  1,000,000 bytes.
- New run-level budget: at most 700,000 model input bytes (~200k tokens)
  across a run's calls, counted from each call's receipt so retries cannot
  resend it; a call past it fails with model_input_budget.
- Run maximum: input priced at 3 bytes/token within the shared 700,000-byte
  budget, filled at the most expensive route first, plus each call's
  4,096-token envelope and full output. Per-call reservations use the same
  rate, so every admissible call sequence fits the pinned maximum. Admitted
  runs keep the terms pinned in their budget.
- File reads and output artifact 64,000 -> 1,000,000 bytes; file calls
  64 -> 256, bridge calls 32 -> 128; bridge message 128 KB -> 4 MB and
  result envelope sized for a 1 MB artifact.
- Service bindings: max_calls 8 -> 32 (per binding and total), responses
  64,000 -> 1,000,000 bytes; gateway wait 25 -> 60 s, Google 22 -> 55 s,
  custom API 20 -> 55 s.
- Authoring guide, creator contract and docs state the new bounds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…er sandboxes

New Codex admissions pin tin-codex-api-v5: v4's 128,000-token output and
8 MiB requests with a 256,000-token context that compacts from 200,000.
Session-funded procedures keep no request/token stop; included, child,
Studio, diagram, design and task work pin the same shape with 256-request
and 8M-token runaway stops and a $1.93 per-request reservation. Funding is
unchanged: Start here work stays included and Tin-funded.

The default root Codex ceiling is $10 (children inside a parent budget keep
$5). Runs and still-valid quotes from before v5 keep v1-v4 and $5.

Procedure sandboxes may declare up to 7,200 s; design/task sandboxes default
to 1,800 s; compute activities allow 3 h (6 h with retries); proxy grants
cover the longest sandbox. Relay rejections (413 context bound, 422
contract, request/token limits, upstream errors) are stored on the attempt
receipt as relay_rejection and named in the run's failure message.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	docs/code-project-files.md
#	src/tin_lite/code_storage.py
# Conflicts:
#	src/tin_lite/catalog.py
#	tests/test_keyword_plan_v6.py
#	tests/test_keyword_plan_v7.py
# Conflicts:
#	docs/workflow-billing-coverage.md
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@demegire
demegire requested a review from a team as a code owner October 2, 2026 18:20
A run whose model calls pass 700,000 input bytes still sends the call; Tin logs one
warning for the run with its ID, workflow, step and byte counts. The run maximum
reserves every declared call at its full max_input_bytes (three bytes per token),
since the bound no longer refuses anything.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
egeozin added a commit that referenced this pull request Oct 2, 2026
* Raise repository snapshot limits and build snapshots through temp files

Repository workflows (site.health_improve, product.code_map) failed on the
workspace limits, and content delivery stopped on files over the 2 MB
per-file limit. Raise the runaway guards: 100,000 files (GitHub's recursive
tree truncates there anyway), 250 MB snapshot, 1 GB tarball, 10 MB per file,
500 blob fallbacks; selected-file reads 100 MB / 20,000 files.

The byte bounds are set by the switchboard VM (an e2-small with about 1 GB
of free RAM and under 5 GB of free disk), which every run in flight shares.
The verified files now wait in a temporary file instead of a dict in memory,
so the switchboard only holds the finished compressed archive. The isolated
sandbox's per-root entry bound rises to 400,000 so a 100,000-file snapshot
plus its .git objects fits (needs a template rebuild to take effect).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Let project memory read 700 KB of sources and keep the newest that fit

project.memory d711b841 failed with "memory sources exceed 200000 bytes".
The sources go whole into one gardener call and the index into later
sessions, so both stay within ~200k tokens: 700,000 bytes. Older sources
that no longer fit are left out instead of failing the run. The bounded
project-file read rises to match the index.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Start new hosted projects at $25 a run, $100 a month, $50 per scheduled run

75 scheduled runs were refused for no sufficient standing limit and four
manual starts for the $10 monthly limit. Only projects without a policy get
the new defaults; saved policies, credits and the welcome grant are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Give content delivery 15 minutes to read and rebuild a repository snapshot

A refresh delivery downloads up to a 1 GB tarball and rebuilds a snapshot of
up to 250 MB on the shared-core switchboard before it commits; 5 minutes
could run out for a large repository. Activity timeouts are not part of
replay history, so running workflows replay unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Model calls: 32,000-token default cap, 600-second default wait, stop signals on receipts

Production caps caused failures without saving money: billing charges the
tokens a call actually used, so a cap only decides when a long answer fails.

- ModelRequest.max_output_tokens defaults to 32,000 (was 4,096). Every
  native caller sets its own cap, so no current request or fingerprint
  changes.
- Provider clients wait 600 seconds by default (was 90), and so does
  TIN_LITE_LUNA_TIMEOUT, which also feeds the Responses client. Activities
  that wrap a default wait now outlast it: project memory, scan report and
  weekly brief 12 minutes, visibility audit 35, answer page 25, character
  design 45, organic panel preparation 85, observation 25, brand checks 35,
  and keyword collection 60. Timeout values are not part of replayed
  commands.
- An empty response at its cap, or one the provider says stopped there
  (Anthropic max_tokens, Gemini MAX_TOKENS, OpenRouter length), is
  output_truncated rather than invalid_result when its structured answer is
  empty or unparseable. Plain text at the cap is still returned.
- native_model_usage_v1 and model external_usage_v1 receipts add
  max_output_tokens, stop_reason and output_truncated. The fields are
  additive; pricing reads none of them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Keyword plan v8: screening caps of 32,000 and 64,000 tokens

v7 is deployed, so it stays as it is. In runs a59cded8 and de1a4d3e the
screening call stopped at exactly 5,000 output tokens after 3.5-4.2k tokens
of reasoning, and v7's 8,000/16,000 caps are sized like answer lengths
rather than runaway guards. New definitions pin keyword-plan-v8 (catalog
organic.keyword_plan 0.8.0): v7 with only the screening caps and their
reservations changed. Batches stay at 50; reasoning effort stays the
model's choice.

- First attempts get 32,000 output tokens and the one retry 64,000, half
  of GPT-6 Luna's 128,000.
- An 80,000-byte request is 84,096 input tokens to the recorder (standard
  band), so the largest first attempt costs $0.0265 and reserves $0.03,
  and the largest retry $0.0425 and reserves $0.045. Six batches and six
  retries reserve $0.45, and a full run at most $2.00: seeds $0.10,
  review $0.15, screening $0.45, 22 lookups $1.10, 40 samples $0.20. The
  $2 floor covers it exactly, so the floor, the catalog default and the
  organic system's keyword limit are unchanged.
- Seeds and review keep their caps; raising either would pass the floor.
- Screening waits up to 600 seconds per call (was 240) for every policy;
  waiting never changes a request.
- v2-v7 stay registered and send exactly what they did.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Raise native model step caps to 32,000 through each step's own versioning

A cap only decides when a long answer fails; billing charges the tokens a
step used. Runs pinned before keep their caps.

- content.plan 0.9.0 pins content-editorial-v8: v7 with 32,000 output
  tokens (was 16,000). At its bounds a plan costs at most $0.088, still
  under the $0.10 its $1 share in the organic system is sized from.
  Definitions pinned to v7 resolve to v7.
- style.capture 1.3.0 (policy 2, was 6,000), social.x_style 1.2.0 (policy 3,
  was 6,000) and social.x_revise 1.2.0 (x-feedback-v2, was 8,000). Style
  capture and X revisions now accept every policy version they shipped and
  send the pinned cap; contexts saved before keep 6,000. x_style's policy 1
  no longer follows style capture's current cap.
- growth.onboarding_plan steps all use 32,000 (were 6,000-16,000); the
  plan's contract digest changes, as with any change to its module.
- creative.character (was 24,000; four Sol calls at every bound cost about
  $1.73 of its $2 ceiling) and the site-health fix (was 16,000), which pin
  no cap.
- Skipped: the organic audit (its $2 ceiling is computed from 6,000-token
  calls), paid ads (Sol reservations sized from their caps), keyword seeds
  and review (would pass the $2 floor) and code workflows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Raise code workflow limits to runaway guards; bound model input per run

Production runs kept hitting conservative code-workflow limits (#273's model
wait, the 64 KB read cap worked around in #89, #239, #261, #270). Limits are
now set well above real use, while model context stays bounded per run.

- timeout_seconds max 60 -> 900 (still the package window and each model
  call's wait; the provider now waits as long instead of its 90 s default);
  execute_code_workflow start_to_close 4 -> 20 min, heartbeats unchanged.
- Model routes: 8 -> 32 calls per run, 4 -> 16 per route, max_input_bytes
  32,000 -> 256,000, max_output_tokens 4,096 -> 32,000; response 64,000 ->
  1,000,000 bytes.
- New run-level budget: at most 700,000 model input bytes (~200k tokens)
  across a run's calls, counted from each call's receipt so retries cannot
  resend it; a call past it fails with model_input_budget.
- Run maximum: input priced at 3 bytes/token within the shared 700,000-byte
  budget, filled at the most expensive route first, plus each call's
  4,096-token envelope and full output. Per-call reservations use the same
  rate, so every admissible call sequence fits the pinned maximum. Admitted
  runs keep the terms pinned in their budget.
- File reads and output artifact 64,000 -> 1,000,000 bytes; file calls
  64 -> 256, bridge calls 32 -> 128; bridge message 128 KB -> 4 MB and
  result envelope sized for a 1 MB artifact.
- Service bindings: max_calls 8 -> 32 (per binding and total), responses
  64,000 -> 1,000,000 bytes; gateway wait 25 -> 60 s, Google 22 -> 55 s,
  custom API 20 -> 55 s.
- Authoring guide, creator contract and docs state the new bounds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Raise Codex limits to runaway guards: contract v5, $10 sessions, longer sandboxes

New Codex admissions pin tin-codex-api-v5: v4's 128,000-token output and
8 MiB requests with a 256,000-token context that compacts from 200,000.
Session-funded procedures keep no request/token stop; included, child,
Studio, diagram, design and task work pin the same shape with 256-request
and 8M-token runaway stops and a $1.93 per-request reservation. Funding is
unchanged: Start here work stays included and Tin-funded.

The default root Codex ceiling is $10 (children inside a parent budget keep
$5). Runs and still-valid quotes from before v5 keep v1-v4 and $5.

Procedure sandboxes may declare up to 7,200 s; design/task sandboxes default
to 1,800 s; compute activities allow 3 h (6 h with retries); proxy grants
cover the longest sandbox. Relay rejections (413 context bound, 422
contract, request/token limits, upstream errors) are stored on the attempt
receipt as relay_rejection and named in the run's failure message.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Fit the keyword plan's catalog comment to the line limit

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Make the code run's model input bound a logged soft gate

A run whose model calls pass 700,000 input bytes still sends the call; Tin logs one
warning for the run with its ID, workflow, step and byte counts. The run maximum
reserves every declared call at its full max_input_bytes (three bytes per token),
since the bound no longer refuses anything.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Give a root Codex run $10 only where its project and wallet can cover it

A session's admission estimate is its whole ceiling, so the new $10 default
refused every Codex procedure in projects still on the $10/$10 hosted
defaults once anything was spent that month, and in $10 welcome wallets after
the first charge. A root run's default ceiling is now $10 when available
credits, the per-run limit and the month's remainder all cover it, and the
earlier $5 otherwise, so nothing is refused that was admitted before. The
preview and admission share the room (run_room, month_usage); a quote keeps
the ceiling it showed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Name a model response OpenAI fails inside its stream

OpenAI can end a response as failed inside a 200 stream; the relay recorded
nothing, so the run said only that Codex failed (on 2026-10-01 three sessions
ended "Codex usage limit reached" this way). The relay now records
rate_limited for OpenAI's rate limit and upstream_failed otherwise, by code
only, and the run's failure message names them in plain words.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Build at most two repository snapshots at once and stream them from disk

At #295's limits a snapshot can download a 1 GB tarball and build a 250 MB
archive, on a switchboard with about 2 GB of RAM and 4.7 GB of free disk
shared by eight concurrent activities. The gateway now builds two at a time,
and the finished archive stays in its temporary file: it streams to the
sandbox and readers open it from the start, instead of a copy held in memory
for the whole run.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Keep project memory's newest sources together and say how many were left out

newest_sources skipped a source that didn't fit and kept looking, so an older
source could be kept while a newer one was dropped, and memory_gardened
counted every source fetched. Keeping now stops at the first source that
doesn't fit (one larger than the whole budget is skipped), and the activity
records the kept and dropped counts and the kept run IDs.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Let style capture, X style and X revise wait as long as their 32,000-token caps need

Their caps rose to 32,000 tokens, but the provider wait stayed at 165 seconds
inside a 180-second step budget and a five-minute Temporal step, so a long
answer timed out before reaching the cap. Each now waits the provider's
600-second default with a 15-second step margin, and the Temporal step that
makes the call gets 15 minutes. Activity options are not workflow commands,
so histories replay unchanged. The forward proxy doc now states the 7,260-second
grant maximum and the proxy host reinstall it needs.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Ege Demir <demegire@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: egeozin <ege@emotionmachine.ai>
@egeozin

egeozin commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Superseded by #297, merged and deployed at ad80527. #297 keeps these commits unchanged and resolves the conflict with #296. It adds the review fixes:

  • a Codex session gets $10 only where the project and wallet can cover it, otherwise $5;
  • at most two repository snapshots are built at once, and they stream to the sandbox from disk;
  • project memory keeps its newest sources together;
  • the model waits match the new caps;
  • OpenAI failures inside a stream are named.

@egeozin egeozin closed this Oct 2, 2026
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.

2 participants