Skip to content

feat(tarko-agent-server, agent-ui): return initialization events from session create#1662

Merged
cjraft merged 7 commits intomainfrom
fix/session-create-events
Sep 26, 2025
Merged

feat(tarko-agent-server, agent-ui): return initialization events from session create#1662
cjraft merged 7 commits intomainfrom
fix/session-create-events

Conversation

@ulivz
Copy link
Member

@ulivz ulivz commented Sep 26, 2025

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

  • Added or updated necessary tests (Optional).
  • Updated documentation to align with changes (Optional).
  • Verified no breaking changes, or prepared solutions for any occurring breaking changes (Optional).
  • My change does not involve the above items.

@netlify
Copy link

netlify bot commented Sep 26, 2025

Deploy Preview for agent-tars-docs ready!

Name Link
🔨 Latest commit 8a3ddb9
🔍 Latest deploy log https://app.netlify.com/projects/agent-tars-docs/deploys/68d63b1526a15600086175d8
😎 Deploy Preview https://deploy-preview-1662--agent-tars-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Sep 26, 2025

Deploy Preview for tarko ready!

Name Link
🔨 Latest commit 8a3ddb9
🔍 Latest deploy log https://app.netlify.com/projects/tarko/deploys/68d63b15dc00b40008e8d6b8
😎 Deploy Preview https://deploy-preview-1662--tarko.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@ulivz ulivz changed the title feat(tarko-agent-server): return initialization events from session create feat(tarko-agent-server, agent-ui): return initialization events from session create Sep 26, 2025
ZhaoHeh
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
@cjraft cjraft merged commit 008124a into main Sep 26, 2025
8 of 9 checks passed
@cjraft cjraft deleted the fix/session-create-events branch September 26, 2025 07:07
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.

3 participants

Comments