feat: refactor ai agent executor#247
Merged
Merged
Conversation
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.
Summary
services/ai-agent/src/agent/executor.py— refactored the conversation-run/event-persistence pipeline after reading the installedopenhands-sdk1.30.0 source directly:_make_token_callback/_TurnStatemachinery.RemoteConversation.__init__'s real constructor has notoken_callbacksparameter — it's silently absorbed by a**_: objectcatch-all (only theConversationfactory's type-checking overload claims to support it), so this code had never fired in production; every agent reply was always persisted through_persist_event's fallback path anyway. Zero behavior change, ~90 fewer lines.events.reconcile()workaround (added to unblock the WS-client-thread-dies-permanently upstream bug, OpenHands/software-agent-sdk#1532) from every 2s poll to every 10s.reconcile()re-walks the entire event history over REST with no incremental cursor, and the SDK's own internal blockingrun()only pays that cost once, at completion — not on every tick. The cheapexecution_statuspoll stays at 2s for stop-responsiveness; a finalreconcile()is still guaranteed on every exit path (done/error/timeout/manual-stop) so a run can never end with an un-persisted tail.ConversationExecutionStatus.is_terminal().services/ai-agent/src/agent/repo_tools.py— removed the built-increate_pull_requesttool. PR/MR creation, review, and commenting is repository-plugin-specific and is handled entirely by each plugin's own tools now, not a built-in agent tool.scripts/install-local-plugin.sh— added support for building and installing a plugin's MCP bundle (mcp/dist/mcp.js) alongside the existing backend/frontend artifacts, for plugins that define anmcp/directory.Type of Change
Test plan
pytest tests/ --ignore=tests/e2e— 83 passedruff check— cleanPACA_E2E=1 pytest tests/e2e— requires Docker; not run in this environment, recommend running before merge since it exercises the real sandbox + WebSocket path this PR touchesChecklist