Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

Commits on main

fix(scripts): stop the e2e coverage gate demanding cfg-gated methods\n\n`collectSchemaMethods` is a static text scan, so it finds every\n`ControllerSchema` literal on disk regardless of `#[cfg]`. The `test` and\n`test_support` namespaces sit behind `e2e-test-support`, which is in neither\n`[features] default` nor `scripts/ci/product-features.txt` — the two lists\n`scripts/test-rust-e2e.sh` builds its `--features` string from — so their six\ncontrollers answer `unknown method` in the very build the gate measures, while\nthe report billed them as uncovered obligations. The only ways to satisfy such\na row were a bespoke feature string or naming the method in a string literal\nthat never calls it, which is the gaming the gate's own header warns about.\n\nThe fix is gate-side and has to be: the schemas are already `#[cfg]`-correct\n(`src/openhuman/mod.rs` gates the whole `test_support` module), and a text scan\nwould find those literals even if every line were `#[cfg(never)]`.\n\nAdds `UNREACHABLE_NAMESPACES` — namespace, gating feature, and reason, the\nshape `INTENTIONALLY_NOT_FORWARDED` uses — and reports the exclusions in the\noutput rather than dropping them silently. Denominator 627 -> 621.\n\nExcluding is the dangerous direction, so each entry is checked against reality\nrather than against its own comment. The gate resolves the measured feature set\nfrom `Cargo.toml` and `product-features.txt` through the feature graph, and\nfails if a gating feature becomes reachable, if an entry names a namespace\ndiscovery cannot find, if a namespace is in both MODULES and this list, or if\nthe feature table cannot be parsed at all. Resolving the graph rather than\ntesting direct membership is what keeps `medulla` measured: it is absent from\nproduct-features.txt but present in `[features] default`, so its nine\ncontrollers are genuine obligations, not exclusions.\n\n`parseCoreFeatureGraph` and `resolveEnabledFeatures` are new exports on\n`scripts/lib/feature-forwarding.mjs`, which already owns `[features]` parsing.\nNo existing export changes.\n\nCloses #6069\n
Shanu committed 2 months ago
d311c1f
fix(tinyagents): bound the restored results and the artifact contents list\n\nBoth from CodeRabbit's review on #6068, and both are the same mistake in\ndifferent places: a message this branch adds that nothing downstream can shrink.\n\n**The contents list could not be shrunk by anything.**\n`ArtifactIndexTocMiddleware` emits a system message, chosen precisely so the\nladder cannot take it — compression keeps system messages verbatim and\n`ImageAwareMessageTrimMiddleware` never evicts one. That is what makes an\nartifact pointer survive; it also means a turn that persisted enough oversized\nresults would grow an unbounded, un-evictable message, and the guarantee that\nmade the pointers safe would be the thing that broke the request. The list is\nnow capped against a tenth of the input allowance and reports how many results\nit left out, so the model still knows they exist.\n\n**Restoration could provoke an eviction.** `FinalCallWrapUpMiddleware` restores\ncleared tool bodies after compression has already run, so an unbounded restore\npushes the request past the window and the trim then evicts whole messages —\nstrictly more destructive than the blanking being undone, and able to discard\nthe very results just restored.\n\nThe review proposed a compression phase after restoration. That is a second\nsummarizer model call on the one call already about to produce the conclusion,\nand it repairs an overflow that is preventable instead: restoring under the same\nallowance the trim enforces means the trim never has cause to fire. Restoration\nis now budget-aware and newest-first — recency is relevance here, because the\nfinal round's results are the ones the model has not seen (the cap is checked\nbefore the request is built) and the earliest are the most likely to be\nreflected in the compression summary already. What does not fit stays cleared,\nand the count of what stayed cleared is logged rather than left silent.\n\nAdds a test for each bound: restoration stops short of the allowance and\nrestores newest-first, and the contents list stays inside its cap while\ndisclosing the omitted count.\n
sanil-23 committed 2 months ago
8a6953c
feat(agent): let an embedder actually supply a payload summarizer\n\n`AgentBuilder::payload_summarizer` is a public setter taking\n`Arc<dyn PayloadSummarizer>` — an advertised extension point — while the trait,\nits outcome type and its reason enum were all `pub(crate)`. So the setter was\nuncallable from outside this crate: an embedder could see the seam and could not\nuse it.\n\nThat is not a hypothetical gap. The default implementation dispatches the\n`summarizer` sub-agent, which is exactly what an embedder may be unable to do —\nOpenCompany withholds spawn tools entirely because upstream's use a\nprocess-global registry and a budget bypass that are unsafe when one process\nserves many tenants. "Bring your own summarizer" is therefore the case this seam\nexists for rather than an exotic one, and it was the case it could not serve.\n\nAlso exposes `summarizer::prompt::ARCHETYPE`, and for the same reason one level\ndown: the trait invites a replacement, and the archetype is where the extraction\ncontract is actually written. Without it every embedder reinvents the prompt,\nand reinvents it worse — a hand-written one tried against this seam dropped the\nper-record identifier section, the structural hints that let a caller decide\nwhether to re-fetch, the error-payload rule and the binary-payload rule. The\nfirst of those was visible immediately: a task asking for issue numbers got\nthirty numbers and no titles, because nothing required an identifying line per\nrecord regardless of what was asked.\n\n`build` stays the entry point for the sub-agent path, which additionally wants\nthe user-files, tools and workspace sections. A caller running one tool-less\nmodel call wants the archetype and nothing else.\n
sanil-23 committed 2 months ago
1e45c21
bd56f29
2abd59d
feat(context): render the persisted-artifact index into the request\n\nA tool result over the per-result budget is written to disk and replaced by a\npreview plus an `artifact_path` pointer. That pointer's only home was the\ntool-result message itself — and tool-result messages are exactly what the\nreduction steps act on. Microcompact replaces a body with the cleared\nplaceholder; compression folds the older slice into a summary that *should*\ncarry paths forward ("prefer concrete facts — paths, names, values") but is a\nmodel call, not a guarantee.\n\nEither way the data ends up intact on disk with nothing in context saying it\nexists, and the failure is silent: every component did its job — the result was\npersisted, the transcript was reduced — so no log fires while the turn quietly\nloses the ability to reach its own findings.\n\nThe index that fixes this has been maintained all along.\n`ToolResultArtifactIndexStore` is registered on `RunContext.stores` and written\non every persist with the tool, call id, path and byte counts. Nothing ever read\nit. `ArtifactIndexTocMiddleware` reads it and renders a short contents list into\neach request.\n\nTwo properties make the list un-destroyable rather than merely durable:\n\n* **Rebuilt per request, never stored.** It is written into the outgoing\n `ModelRequest` and never into the loop's transcript, so there is no copy for a\n later pass to blank, fold or evict, and repeated calls cannot stack stale\n lists. It is also always current — an artifact persisted last round shows up\n next call with no bookkeeping.\n* **Emitted as a system message, at the tail.** Compression keeps every system\n message verbatim and the trim never drops one, so the single thing that says\n where the data went is the one thing the ladder may not take. Appending rather\n than prepending leaves the cacheable prompt prefix untouched.\n\nRows are sorted because the index is a `HashMap` and its iteration order is not\nstable; an unstable order would rewrite the message every call for no reason.\nAbsent entirely when nothing has been offloaded, so a turn that never overflowed\na result spends no context on it.\n
sanil-23 committed 2 months ago
629e361
418c9a4
fix(context): summarize before blanking, and only blank under real pressure\n\nTwo defects in the mid-turn context ladder, both of which quietly cost a turn\nthe results it had gathered.\n\n**Microcompact ran before compression.** `context_mw.install` registered it, so\nits `before_model` fired ahead of the summarization step installed later. By the\ntime the task-aware summarizer ran, every tool body past `keep_recent` had\nalready been replaced with `CLEARED_PLACEHOLDER` — and its own prompt asks for\n"## Completed Actions ... with key results/outputs". It was summarizing\nplaceholders. The one component able to preserve those results in condensed form\nnever saw them. Microcompact now installs after compression, so the ladder reads\nsummarize -> blank -> evict, cheapest sufficient step first.\n\n**And it blanked unconditionally.** Constructed bare, `MicrocompactMiddleware`\nleaves `token_budget: None`, which the crate documents as "always blank once past\nkeep_recent". Not under context pressure — on every model call. So a turn that\nmade ten tool calls composed its answer from the last five results with the rest\nblanked, while sitting well inside a window with room for all ten. That is not a\ncapped-turn problem: it is every turn, including ones that finish normally, and\nevery answer was quietly poorer for it. The crate added `with_token_budget` for\nexactly this (tinyhumansai/openhuman#4755) and this call site never used it; it\nnow does, sized to the same input allowance the trim uses. On a 240k window a\nmaxed-out 25-round turn lands well under budget, so nothing is blanked at all.\n\nA run with no advertised context window keeps the legacy always-blank behaviour:\nthere is no budget to size against and nothing else bounding the transcript, so\ndropping the blanking there would trade a lossy transcript for one that grows\nuntil the provider rejects it.\n\nAlso gives the cap wrap-up back what blanking took. `FinalCallWrapUpMiddleware`\nnow carries the tool-outcome sink and, on the concluding call only, restores any\nbody still reading as the placeholder — the one call that has to report\neverything should not be reporting on content it cannot read. It is sited\nbetween microcompact and the trim so the restored transcript is still bounded.\n\nCovers the wrap-up middleware directly for the first time: no-op with budget\nremaining, tools withdrawn and instruction appended on the last call, cleared\nresults restored, and a result that was never cleared left alone.\n
sanil-23 committed 2 months ago
9cc58d9
fix(auth): drop every current-user cache on sign-out (#5758)
Nguyen Thanh Dat committed 3 months ago
2c9012b