Skip to content

[OMEGA-350] token budget fix, V2 implementation - #354

Draft
paul-v-snet wants to merge 1 commit into
MeTTaClaw2-vitalyfrom
OMEGA-350-on-metta-claw2
Draft

paul-v-snet wants to merge 1 commit into
MeTTaClaw2-vitalyfrom
OMEGA-350-on-metta-claw2

Conversation

@paul-v-snet

Copy link
Copy Markdown
Collaborator

Description

A ⚠️vibe-coded⚠️ implementation of #337 for Omega V2.

What I did by myself in this PR:

What's different compared to #337:

  • Implemented LLM_TRUNCATED_CALL_HINT, which is added to the LLM error response when a tool call is broken and the finish_reason is length or max_output_token, so that the LLM can try to use a smaller response and solve the issue itself.

How Has This Been Tested?

Ran live tests for OpenAI, ASICloud, and OpenRouter - all passed.

Checklist

  • PR contains autogenerated code
  • Self-review completed
  • Test scenarios above are passed with the version of the code from PR

@paul-v-snet
paul-v-snet requested a review from vsbogd September 17, 2026 12:22
@paul-v-snet paul-v-snet changed the title providers | OMEGA-350 fix, V2 implementation [OMEGA-350] token budget fix, V2 implementation Sep 17, 2026
@TossSky

TossSky commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

@paul-v-snet @vsbogd tested e3a8a38: built the image, ran this branch's CI, and ran live sessions on OpenRouter with z-ai/glm-5.2 at the default config and at maxOutputToken: 120.

What I checked:

  • [LLM_USAGE] is at INFO on every call: 105 calls in the 120 run and 58 at the default.
  • 17 replies at 120 and 2 at the default came back with finish_reason=length, and each one produced the empty-reply notice.
  • The V1 history problem does not exist here. The notice never reaches the prompt: 0 copies across all 105 and 58 REQUEST: lines, because history goes through the episodic buffer where the assistant message is kept as [TOOL CALL] and the send result as RETURN: None. On #337 the same scenario put 45 copies into a single prompt.
  • LLM_TRUNCATED_CALL_HINT did not fire in either run, so that path is still unverified live.

CI on this branch: MeTTa tests green, tests/pytest.sh 65 passed, Phase 1 2 failed, 127 passed. The two failures are mock/test_openclaw_delegate_mock.py::test_delegate_stays_async_under_a_slow_gateway_mock and mock/test_pin_invisible_within_iteration_mock.py::test_pin_invisible_within_iteration_mock, and the base branch run fails with exactly the same two, so they are not from this PR.

One thing outside this diff. At the default budget the container died while the agent was writing the escaped JSON of step 6:

ERROR: [Thread main] /PeTTa/src/main.pl:23: user:main Syntax error: Parse error in form: (append-file "/tmp/data.txt" "{\"path\":\"C:\\Program Files (x86)\\AMD\", ...

The tool call is parsed before it reaches eval in src/loop.metta, so a malformed argument takes down the interpreter rather than one iteration. I saw it once and my attempt to reproduce it failed for an unrelated reason, so treat it as a single observation. It deserves its own ticket.

Verdict: PASS for the changes in this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants