feat(tarko-agent-server, agent-ui): return initialization events from session create#1662
Merged
feat(tarko-agent-server, agent-ui): return initialization events from session create#1662
Conversation
✅ Deploy Preview for agent-tars-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for tarko ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
ZhaoHeh
previously approved these changes
Sep 26, 2025
…reate - Add events to createSession API response containing initialization events - Update frontend to process initialization events immediately after session creation - Ensures environment_input and other initialization events are visible in UI - Resolves issue where agent initialization events were stored but not displayed Fixes session create event persistence issue where events generated during agent.initialize() were saved to storage but not returned to frontend, causing them to only appear after page refresh.
- Create session in storage BEFORE initializing AgentSession - Prevents 'Session not found' errors when events are saved during agent initialization - Maintains proper event persistence without timing conflicts The previous implementation created AgentSession and initialized it before creating the session record in storage, causing events generated during initialization to fail when trying to save to a non-existent session.
…ed before returning them - Add pendingEventSaves tracking in AgentSession to monitor async storage operations - Implement waitForEventSavesToComplete() to ensure all events are saved before querying - Replace arbitrary timeout with proper synchronization in session creation - Fixes race condition where events were still being saved when API returned initialization events
…panel - Always show first environment_input event (initialization screenshot) in active panel - Fixes issue where initial browser screenshot wasn't visible in UI - Maintains existing logic for subsequent environment_input events from browser_vision_control tool
- Use sessionPanelContentAtom instead of activePanelContentAtom for direct updates - Properly handle session-specific panel content storage - Fixes issue where first environment_input wasn't updating panel content correctly
ea2beb9 to
8a3ddb9
Compare
cjraft
approved these changes
Sep 26, 2025
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
Resolves session initialization event persistence issue where events generated during
agent.initialize()were stored in backend but not returned to frontend, causing them to only appear after page refresh.Checklist