Feat/inflight tracking - #128
Merged
Merged
Conversation
added 2 commits
May 24, 2026 23:44
Faithful port of DeepSeek-Reasonix src/repair/scavenge.ts (201 LOC).
ScavengeToolCalls scans reasoning_content for tool calls the model
forgot to emit in the structured tool_calls field. Three patterns:
1. DSML invoke blocks (<|DSML|invoke name="tool">...</>)
with full-width-pipe (U+FF5C) and ASCII pipe variants
2. Raw JSON objects: {name, arguments}
OpenAI-style: {type:"function", function:{name,arguments}}
R1 free-form: {tool_name, tool_args}
3. Deduplication by (name, args) signature prevents double-counting
Integration: after extracting declared tool calls, the loop scans
reasoning content (Thinking blocks) + assistant text (Text blocks),
calls scavenge_tool_calls with the context's tool names as the
allowlist, and merges novel calls. Port of repair/index.ts:65-85.
Safety: 100KB input cap, max-calls=4 cap, allowed-names gate.
Tests: 13 tests ported from Reasonix tests/repair/scavenge.test.ts.
All 190 agent_loop tests pass. Build + fmt + clippy clean.
Faithful port of DeepSeek-Reasonix src/core/inflight.ts (52 LOC). InflightSet: authoritative running-id tracker. Thread-safe (Mutex<HashSet<String>>). Cards derive spinner state from inflight.has(call_id) instead of trusting end-event delivery. - Loop creates InflightSet at run_loop start (Reasonix loop.ts:147) - Sequential dispatch: inflight.add after ToolExecutionStart, inflight.delete after tool_result_message — finally-contract - Parallel dispatch: inflight.add at preflight, inflight.delete inline for Immediate path and in spawned future for Prepared - execute_tool_calls umbrella passes inflight through to children Tests: 8 tests ported from Reasonix tests/inflight.test.ts. All 198 agent_loop tests pass. Build + fmt clean.
allen-munsch
pushed a commit
to allen-munsch/dirge
that referenced
this pull request
Jun 3, 2026
Merge feat/inflight-tracking with conflict resolution. Fixes applied: - inflight.rs: replace unwrap() with poison-safe lock handling - tools.rs: move inflight.add() inside Prepared arm only, avoiding wasteful add-then-immediate-delete for Immediate outcomes - run.rs: wire inflight through execute_tool_calls_with to both sequential and parallel dispatch paths, remove dead import
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.
No description provided.