Skip to content

fix(tarko-agent-ui): display environment input on session creation#1667

Merged
ZhaoHeh merged 16 commits intomainfrom
fix/environment-input-display
Sep 26, 2025
Merged

fix(tarko-agent-ui): display environment input on session creation#1667
ZhaoHeh merged 16 commits intomainfrom
fix/environment-input-display

Conversation

@ulivz
Copy link
Member

@ulivz ulivz commented Sep 26, 2025

Summary

Fix issue where Environment Input from /api/v1/sessions/create was not displaying in Workspace. Modified EnvironmentInputHandler to bypass shouldUpdatePanelContent check for first environment_input events, ensuring initialization screenshots are properly shown during session creation while maintaining existing browser_vision_control panel behavior.

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.

- Modified EnvironmentInputHandler to bypass shouldUpdatePanelContent check for first environment_input
- Ensures initialization screenshots from createSession are displayed in workspace
- Maintains existing browser_vision_control panel behavior
@netlify
Copy link

netlify bot commented Sep 26, 2025

Deploy Preview for tarko ready!

Name Link
🔨 Latest commit fa193ae
🔍 Latest deploy log https://app.netlify.com/projects/tarko/deploys/68d6a7b588908000085f71ab
😎 Deploy Preview https://deploy-preview-1667--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.

@netlify
Copy link

netlify bot commented Sep 26, 2025

Deploy Preview for agent-tars-docs ready!

Name Link
🔨 Latest commit fa193ae
🔍 Latest deploy log https://app.netlify.com/projects/agent-tars-docs/deploys/68d6a7b43f2fab000869b345
😎 Deploy Preview https://deploy-preview-1667--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.

- Move isFirstEnvironmentInput check before adding message to messagesAtom
- Ensures correct detection of first environment_input during session creation
- Removes debug statements
…etting

- Add detailed logging to understand why panel content is not being set
- Check conditions and values during environment input processing
…ronment screenshot

- Check if environment_input has set browser_vision_control panel before auto-selecting files
- Preserve environment screenshot display during session creation
- Add logging to track panel content decisions
…ing environment screenshot"

This reverts commit 7112c2e.
…control

- Add required source field and arguments structure for BrowserControlRenderer
- Include _extra.currentScreenshot with image URL for screenshot display
- Ensure panel content matches expected format for extractBrowserControlData
- First environment input uses simple 'image' type instead of 'browser_vision_control'
- Only use browser_vision_control renderer for updating existing browser panels
- Remove debugger statements and simplify conditional logic
- Separate handling for initialization vs browser control updates
- Log panel content object before setting
- Add timeout check to verify content was actually set
- Debug sessionPanelContentAtom state changes
…ent panel content

- createSessionAction only auto-selects files if no panel content was set by initialization events
- setActiveSessionAction preserves existing panel content when no files are available
- Add logging to track panel content preservation decisions
- Ensure environment input panel content is not cleared by file auto-selection logic
- Remove all console.log debug statements
- Remove setTimeout debug code
- Keep only essential logic for environment input display
- Maintain minimal changes approach
- Remove file auto-selection modifications from createSessionAction
- Remove panel content protection from setActiveSessionAction
- These changes were not related to the core environment input display issue
- Keep only the essential EnvironmentInputHandler fixes
- Remove confusing shouldUpdate variable with redundant conditions
- Use clear if-else-if chain for different scenarios:
  1. First environment input -> simple image type
  2. Existing browser_vision_control -> update it
  3. Other cases -> check shouldUpdatePanelContent
- Eliminate duplicate condition checks
- Extract common panel properties into basePanelContent object
- Combine browser_vision_control conditions to avoid duplication
- Single set() call instead of multiple identical ones
- Reduce code from ~70 lines to ~45 lines while maintaining same logic
- Check if panel content already exists before auto-selecting files
- Only auto-select files when no panel content was set by events
- This preserves environment input screenshots after browser refresh
- Fixes issue where environment screenshots disappeared on page reload
@ZhaoHeh ZhaoHeh merged commit 2fb6c8f into main Sep 26, 2025
7 of 9 checks passed
@ZhaoHeh ZhaoHeh deleted the fix/environment-input-display branch September 26, 2025 14:48
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.

2 participants

Comments