blog: Closing the Estimate-Actual Gap with cost_fn#644
Open
amavashev wants to merge 5 commits into
Open
Conversation
…post-internal-review)
…-extractor distinction, v0.2.3 heading, softer absolute
… CostFn alias type, soften absolutes, terminology + tone
… alias annotation
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
blog/langchain-runcycles-cost-fn-actual-cost.md— the first dedicated post onlangchain-runcycles, the LangChainAgentMiddlewareintegration that adds pre-execution budget authority forcreate_agentworkflows. Focused angle: how v0.2.0'scost_fnparameter closes the estimate-as-actual gap that v0.1.x explicitly shipped with, plus v0.2.3's settlement-HTTP-failure correctness patch.Differentiator vs existing LangChain/LangGraph coverage
langgraph-budget-control-durable-execution-retries-fan-out.md(2026-03-21)26-integrations-every-ai-framework-one-budget-protocol.mdAgentMiddleware-level cost-actuals story; the layer below the graphCodex round-1 confirmed: "Differentiator holds: cleanly distinguishes Spring AI advisor-chain, LangGraph graph-level controls, and this middleware-level actual-cost story."
Review cycles completed
Where codex earned its run (catches human reviewer missed)
tests/test_model_gate_streaming.py+ 3 regression tests verified). Removed false bullet.examples/multi_agent_fanout.py+ write-up). Removed false bullet.CostFnalias type — actual source_config.pydefines it asCallable[[Any], Amount], notCallable[[ModelResponse], Amount]. Fixed at two occurrences.The two false-deferred claims would have been instantly checkable against the public GitHub releases page. The skill's source-fetch clause in the codex prompt template earned this run.
Where human reviewer earned its round (codex missed)
Amount/Unitimports in the runnable code exampleFinal scorecard: 9.8 / 10
Test plan
npm run dev) — verify post lands at/blog/langchain-runcycles-cost-fn-actual-cost<title>is ≤ 60 chars (44-char frontmatter +— Cycles)Amount/Unitcorrectly imported fromruncycles)Notes for
/blogskill follow-upCodex flagged that the prompt-template example paths (
src/langchain_runcycles/...) are stale for this repo's actual layout (langchain_runcycles/..., nosrc/prefix). Worth updating the skill's codex-prompt template to instruct codex to discover paths rather than trust example paths verbatim.