Conversation
Owner
assagman
commented
Dec 19, 2025
- Reworked ReAct loop to use a bounded trajectory renderer + context-overflow retry (internal/module/react.go, internal/module/react_trajectory.go, internal/module/react_context.go)
- Encoded tool observations as size-bounded JSON envelopes with deterministic truncation + stable hashes (internal/module/react_tool_result.go)
- Added termination policies (repeated tool calls, stagnation, repeated errors) and captured final candidates (internal/module/react_termination.go)
- Added extractor fallback to synthesize signature-valid outputs when loop can’t (structured-mode supported) (internal/module/react.go:239-260, :702-829)
- Added Prediction.Metadata and helpers; ReAct now records iterations/termination/extraction diagnostics there (internal/core/prediction.go, internal/module/react.go:239-260)
- Ensured Program deep-copies prediction diagnostics + metadata (internal/module/program.go:723-755)
- Expanded ReAct test coverage for truncation, termination, overflow recovery, extraction, implicit finish (internal/module/react_test.go)
- Updated docs to describe ReAct guarantees, bounded trajectories, and termination behavior (QUICKSTART.md, ARCHITECTURE.md, REFERENCE.md)
Refactor ReAct around a trajectory/termination model to keep tool results and prompt size bounded, detect context overflow, and fall back to a post-loop extractor when the loop can’t produce signature-valid outputs. Add flexible Prediction.Metadata for iteration counts/termination diagnostics and update docs/examples to describe the new guarantees and tuning knobs. Signed-off-by: assagman <ahmetsercansagman@gmail.com>
Signed-off-by: assagman <ahmetsercansagman@gmail.com>
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.