Skip to content

Fix native loop history and terminal provider errors - #411

Open
Wube2106 wants to merge 1 commit into
singnet:mainfrom
Wube2106:fix/409-native-loop-history-errors
Open

Wube2106 wants to merge 1 commit into
singnet:mainfrom
Wube2106:fix/409-native-loop-history-errors

Conversation

@Wube2106

Copy link
Copy Markdown

Description

This PR addresses issue #409, where native OpenAI Responses API history was not preserved across conversation turns and terminal provider errors did not stop further inference.

Previously, native history retained function calls but could lose other provider-specific response items, such as reasoning items and their associated identifiers. Additionally, provider exceptions could be converted into empty responses, losing the error information needed to stop inference.

This PR:

  • Preserves native OpenAI Responses API output items across turns, including reasoning items and function-call identifiers.
  • Retains structured conversation history using a bounded policy of the most recent 10 user exchanges.
  • Preserves provider exceptions as explicit errors instead of converting them into empty responses.
  • Identifies terminal quota, authentication, and budget failures and stops further autonomous inference until new user input arrives.
  • Keeps transient rate-limit errors nonterminal by default.

How Has This Been Tested?

  • Python test suite: 256 passed, 5 skipped.
  • Added tests for native response-item preservation and replay across multiple turns.
  • Added tests for provider exception propagation, terminal error classification, and bounded message history.
  • Verified that transient rate-limit errors are not automatically classified as terminal.
  • git diff --check passed.
  • The full test runner was attempted, but MeTTa tests encountered import errors involving paths such as ./src/config and ./tests/lib/utils.

Checklist

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

Closes #409

This branch has not been deployed

No deployments
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.

v0.1.21 native loop clears typed history and continues after terminal provider errors

1 participant