[PR #3741] [CLOSED] [GUI] Finish MCP replies after the tool-round limit #4760

Closed
opened 2026-11-07 15:38:53 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/3741
Author: @i-Vladimir-i
Created: 10/22/2026
Status: ❌ Closed

Base: main ← Head: codex/mcp-limit-final-answer


📝 Commits (1)

  • d41d26d [Codex]: finish MCP replies after the tool-round limit

📊 Changes

4 files changed (+109 additions, -14 deletions)

View changed files

📝 docs/DETAILS.md (+5 -3)
📝 serve/server.py (+14 -5)
📝 serve/test_mcp.py (+89 -5)
📝 serve/web/app.js (+1 -1)

📄 Description

When the web chat reaches mcp.max_rounds, the current main can finish tool activity without a final answer.
This fix retains the last results and errors, then gives the model one final generation with tools removed.
The default remains eight tool rounds; a round can contain several calls.

The original server, test and UI delta is preserved. The conflict with current main was only in docs/DETAILS.md:
the current main text is retained and only the MCP limit paragraph is updated. No obsolete neighboring sections
are restored. Requests finishing before the limit and ordinary client-owned tools retain their paths.

Tested source: main 4b9e05a2a806a3fe24f7b2560d98626c37dade35 plus feature patch SHA256
afcf72dc45ab666aba2381f7a5b7edb9dfefbf478dd96f03bf5490ccf440cf32.
Published head: d41d26dd444e05792375a3ffd7dfa936d5cf93dd.
Its full tree matches the validated candidate index. Code patch-id
594b16aacde9355db3e84641efc2d51f8731ea44 matches the original PR.

Passed, Linux/Python3.12, CPU/mock only:

  • Candidate MCP suite: 30 tests, exit 0. Six focused methods: 6 passed on candidate.
  • Complete server discovery: candidate 1025 passed / 15 skipped of 1040, exit 0;
    same-day clean main 1020 passed / 15 skipped of 1035, exit 0.
  • node --check serve/web/app.js on both arms and git diff --check: exit 0.
  • Source/production-file integrity unchanged. No installs, GPU model, service changes or deployment.

Failed / control: the same six focused methods run against main produce four assertion failures and two passes.
They confirm missing finalization and retained tools. Candidate has no failures. Raw failing logs are retained.

Not run: live model/catalog/browser, Windows and optional SDK/schema/pack tests skipped by the suites.
Native backend builds are not run because no C++ or kernel file changes. Fifteen skips on each arm:
three Anthropic SDK, six pack/tokenizer, three jsonschema and three Windows.

Commands: python -m unittest serve.test_mcp -v,
python -m unittest discover -s serve -p 'test*.py' -v, and node --check serve/web/app.js.
Exact command/exit records and raw logs are retained in the dev work directory. Selected actual output follows.
Focused, MCP and full discovery counts overlap and are not added together.

This is a final model generation, not a server-generated summary. Cancellation, context and output-token limits
remain in the existing request path. Model compliance and answer quality are not established by mock tests.

Selected dev output

main, complete discovery (exit 0):

Ran 1035 tests in 403.282s

OK (skipped=15)

candidate, complete discovery (exit 0):

Ran 1040 tests in 359.359s

OK (skipped=15)

Current-head CI and follow-up control

On d41d26dd444e05792375a3ffd7dfa936d5cf93dd, title and intake checks passed;
sweep was skipped. The Linux runtime job
passed installation of the pinned runtime requirements and its fake-engine smoke check,
then failed the full server suite: 1040 tests, 1 failure, 15 skipped, exit 1.

The failing assertion is in
serve.test_responses.NoLeakedSampler.test_server_close_ends_the_sampler:
the global count of threads named (_loop) is 1 rather than the expected 2.
serve/test_responses.py and serve/telemetry.py are blob-identical to current main.

Follow-up on dev, Python 3.12, CPU/mock only: the unchanged test passed 3/3 on clean
main and 3/3 on this published source. A separate synthetic control ends a neighboring
sampler-like thread between the two global counts. It reproduces the exact 1 != 2
assertion on both main and this head while the new server's own sampler runs and then
stops correctly on server close. Neither feature source nor the test was edited.

That control establishes a pre-existing weakness of the global-count assertion;
the actual thread interleaving in the Python 3.11 GitHub run was not instrumented,
so it does not prove that this was the precise CI interleaving. The failed CI run
is retained as failed; it was not rerun to obtain a green result.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/3741 **Author:** [@i-Vladimir-i](https://github.com/i-Vladimir-i) **Created:** 10/22/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `codex/mcp-limit-final-answer` --- ### 📝 Commits (1) - [`d41d26d`](https://github.com/Niko1221/Strata/commit/d41d26dd444e05792375a3ffd7dfa936d5cf93dd) [Codex]: finish MCP replies after the tool-round limit ### 📊 Changes **4 files changed** (+109 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `docs/DETAILS.md` (+5 -3) 📝 `serve/server.py` (+14 -5) 📝 `serve/test_mcp.py` (+89 -5) 📝 `serve/web/app.js` (+1 -1) </details> ### 📄 Description When the web chat reaches `mcp.max_rounds`, the current main can finish tool activity without a final answer. This fix retains the last results and errors, then gives the model one final generation with tools removed. The default remains eight tool rounds; a round can contain several calls. The original server, test and UI delta is preserved. The conflict with current main was only in docs/DETAILS.md: the current main text is retained and only the MCP limit paragraph is updated. No obsolete neighboring sections are restored. Requests finishing before the limit and ordinary client-owned tools retain their paths. Tested source: main `4b9e05a2a806a3fe24f7b2560d98626c37dade35` plus feature patch SHA256 `afcf72dc45ab666aba2381f7a5b7edb9dfefbf478dd96f03bf5490ccf440cf32`. Published head: `d41d26dd444e05792375a3ffd7dfa936d5cf93dd`. Its full tree matches the validated candidate index. Code patch-id `594b16aacde9355db3e84641efc2d51f8731ea44` matches the original PR. **Passed**, Linux/Python3.12, CPU/mock only: - Candidate MCP suite: 30 tests, exit 0. Six focused methods: 6 passed on candidate. - Complete server discovery: candidate 1025 passed / 15 skipped of 1040, exit 0; same-day clean main 1020 passed / 15 skipped of 1035, exit 0. - `node --check serve/web/app.js` on both arms and `git diff --check`: exit 0. - Source/production-file integrity unchanged. No installs, GPU model, service changes or deployment. **Failed / control:** the same six focused methods run against main produce four assertion failures and two passes. They confirm missing finalization and retained tools. Candidate has no failures. Raw failing logs are retained. **Not run:** live model/catalog/browser, Windows and optional SDK/schema/pack tests skipped by the suites. Native backend builds are not run because no C++ or kernel file changes. Fifteen skips on each arm: three Anthropic SDK, six pack/tokenizer, three jsonschema and three Windows. Commands: `python -m unittest serve.test_mcp -v`, `python -m unittest discover -s serve -p 'test*.py' -v`, and `node --check serve/web/app.js`. Exact command/exit records and raw logs are retained in the dev work directory. Selected actual output follows. Focused, MCP and full discovery counts overlap and are not added together. This is a final model generation, not a server-generated summary. Cancellation, context and output-token limits remain in the existing request path. Model compliance and answer quality are not established by mock tests. ### Selected dev output main, complete discovery (exit 0): ```text Ran 1035 tests in 403.282s OK (skipped=15) ``` candidate, complete discovery (exit 0): ```text Ran 1040 tests in 359.359s OK (skipped=15) ``` ### Current-head CI and follow-up control On `d41d26dd444e05792375a3ffd7dfa936d5cf93dd`, title and intake checks passed; sweep was skipped. The [Linux runtime job](https://github.com/Niko1221/Strata/actions/runs/40466840491/job/122064190382) passed installation of the pinned runtime requirements and its fake-engine smoke check, then failed the full server suite: 1040 tests, 1 failure, 15 skipped, exit 1. The failing assertion is in `serve.test_responses.NoLeakedSampler.test_server_close_ends_the_sampler`: the global count of threads named `(_loop)` is 1 rather than the expected 2. `serve/test_responses.py` and `serve/telemetry.py` are blob-identical to current main. Follow-up on dev, Python 3.12, CPU/mock only: the unchanged test passed 3/3 on clean main and 3/3 on this published source. A separate synthetic control ends a neighboring sampler-like thread between the two global counts. It reproduces the exact `1 != 2` assertion on both main and this head while the new server's own sampler runs and then stops correctly on server close. Neither feature source nor the test was edited. That control establishes a pre-existing weakness of the global-count assertion; the actual thread interleaving in the Python 3.11 GitHub run was not instrumented, so it does not prove that this was the precise CI interleaving. The failed CI run is retained as failed; it was not rerun to obtain a green result. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:38:53 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#4760
No description provided.