Repository navigation
fix: enable the OpenHands SDK default condenser - #383
Open
mnajafian-nv wants to merge 7 commits into
Open
mnajafian-nv wants to merge 7 commits into
mnajafian-nv wants to merge 7 commits into
Conversation
The OpenHands SDK leaves Agent.condenser unset, and the adapter built its agent without one. Long runs therefore resent the full event history on every model request, and a context-window error from the model failed the invocation instead of triggering condensation. Configure the SDK default_condenser, the LLMSummarizingCondenser sizing (80 events, keep the first 4) that the OpenHands default agent uses. Pass the agent LLM object itself rather than a copy with a separate usage ID, so summarization calls accrue to the metrics the adapter reports as invocation usage. This changes default runtime behavior for OpenHands runs. The adapter descriptor declares no settings, so the condenser is not configurable. Signed-off-by: mnajafian-nv <mnajafian@nvidia.com>
The OpenHands adapter now summarizes older conversation history. Document when condensation triggers, that summarization calls count toward invocation usage, and that NeMo Fabric does not expose settings to disable or tune it. Signed-off-by: mnajafian-nv <mnajafian@nvidia.com>
Condensing history by default adds summarization model calls and can change results for an unchanged configuration. Give users who need the previous behavior, for example to compare against earlier runs, an explicit opt-out through the adapter's existing settings schema rather than a new configuration surface. harness.settings.condenser accepts default, the OpenHands SDK default condenser, or none, which builds the agent without a condenser as before. Planning rejects any other value. Planning does not apply schema defaults, so the adapter treats a missing value as default. Regenerate the adapter catalog for the descriptor change and document the setting in the adapter README, the integration guide, and the adapter configuration matrix. Signed-off-by: mnajafian-nv <mnajafian@nvidia.com>
The adapter enabled the condenser for every condenser value other than "none". Planning rejects other values, but a host that starts the adapter without planning could pass "off" or "None" and silently get summarization calls, which cost model usage. Accept only "default" and "none" in the adapter and raise openhands_condenser_invalid for anything else, matching how an existing adapter re-validates its enum settings. Add a test for unknown string and null values. Signed-off-by: mnajafian-nv <mnajafian@nvidia.com>
Each condensation returns from an OpenHands agent step, and the SDK counts every step toward max_iteration_per_run, which the adapter sets from runtime.max_turns. A run with a tight max_turns that used to finish can now stop at the iteration limit, so say so. Also state that the trigger is the history sent to the model rather than the total event count, replace the sentence that contradicted the condenser setting with "does not expose condenser tuning parameters", mention that other setting values are rejected, and wrap the new paragraphs like the surrounding text. Signed-off-by: mnajafian-nv <mnajafian@nvidia.com>
The condenser tests only checked how start() builds the agent, so nothing showed that a run condenses its history, keeps going, and reports the summarization call in invocation usage. Drive the adapter with OpenHands SDK 1.50.0 and a stubbed LiteLLM transport: once past the 80-event limit, and once after a context window error. Each case asserts one Condensation event, a successful finish, and usage that includes the summarization call. The test skips when the OpenHands SDK is not installed. Signed-off-by: mnajafian-nv <mnajafian@nvidia.com>
Signed-off-by: mnajafian-nv <mnajafian@nvidia.com>
|
Fern docs preview: https://nvidia-preview-pull-request-383.docs.buildwithfern.com/nemo/fabric |
This branch was successfully deployed
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.
Overview
Enable the OpenHands SDK default condenser. Without it, long runs resend their full history and can fail at the model context limit. Runs now summarize older events by default;
harness.settings.condenser: nonekeeps the previous behavior. Summarization adds to reported model usage and consumes amax_turnsiteration. No dependency change.Details
default/nonesetting; regenerate the adapter catalog.Validation
Where should the reviewer start?
Review
start()and_condenser_enabled()inadapters/python/openhands/src/nemo_fabric_adapters/openhands/adapter.py, then the two SDK-backed cases intests/adapters/test_openhands.py.Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)
Relates to: none
I confirm this contribution is my own work, or I have the right to submit it under this project's license.
I searched existing issues and open pull requests, and this does not duplicate existing work.
Summary by CodeRabbit
condensertononeto preserve the full conversation history. Supported values aredefaultandnone.