Skip to content

fix: improve page stability and parameter setting reliability#11

Closed
maebahesioru wants to merge 19 commits intoMag1cFall:mainfrom
maebahesioru:main
Closed

fix: improve page stability and parameter setting reliability#11
maebahesioru wants to merge 19 commits intoMag1cFall:mainfrom
maebahesioru:main

Conversation

@maebahesioru
Copy link
Contributor

  • Clear chat verification: fallback to textarea when zero_state not visible
  • Tools panel / Google Search: skip if button not found (new UI layout)
  • Parameter setting: add blur + Tab, use triple_click for reliable fill
  • Submit Button wait timeout: 2s -> 10s
  • Textarea locator timeout: 5s -> 15s
  • Fuzzy model ID matching when model not in parsed_model_list
  • Downgrade noisy button check warnings to DEBUG

maebahesioru added 19 commits March 18, 2026 19:59
- _verify_chat_cleared: if zero_state not visible, fallback to waiting
  for textarea (more reliable page-ready indicator)
- queue_worker: downgrade button check failure from WARNING to DEBUG
- page_controller: downgrade shortcut submission verification failure
  from WARNING to DEBUG
- click_element for Submit Button: internal_timeout 2000ms -> 10000ms
- request_processor: if model id not in parsed_model_list, try fuzzy
  match (e.g. gemini-2.5-flash -> gemini-2.5-flash-preview-04-17)
- _verify_chat_cleared: fallback to textarea visibility when zero_state
  not visible, ensuring page is ready before proceeding
- _ensure_tools_panel_expanded: skip if button not found (new UI layout)
- _adjust_google_search: skip if toggle not found
- _set_parameter_with_retry: add blur event + Tab key, use triple_click
  for reliable field clearing before fill
- submit_prompt: increase textarea locator timeout 5s -> 15s
- click_element for Submit Button: timeout 2s -> 10s
- STREAM proxy port wait: 10s -> 30s (Windows multiprocessing startup is slow)
- initialization: textarea visibility wait: 10s -> 30s
…ggle wait

- triple_click not available in this Playwright version, use select_text instead
- Google Search toggle: wait 0.5s -> 1.0s after click for state to update
- stop sequence press timeout: 3s -> 5s
- Google Search toggle: use force click to bypass overlay issues
…cation

- initialization: catch TargetClosedError during page init, skip gracefully
- initialization/model_management: downgrade noisy warnings to DEBUG
- _set_parameter_with_retry: is_equal extracts float from strings like 'user:1.0'
- _set_parameter_with_retry: input_value timeout 2s -> 5s
- initialization: outer exception handler skips CRITICAL for browser-closed errors
- app.py: Application startup failed logs WARNING instead of CRITICAL for browser-closed
- model_management: UI state errors log DEBUG instead of ERROR for browser-closed
- shortcut submission: textarea focus timeout 5s -> 15s
- timeouts: SLEEP_LONG 0.5s -> 1.0s for more reliable parameter setting
- _set_parameter_with_retry: use Ctrl+A instead of select_text for reliable
  full selection in Angular spinbuttons
- submit_prompt: if shortcuts fail but response already started, treat as
  success instead of attempting button click (avoids 500 errors)
…n port failure

- model_management: TargetClosedError in set_model_from_display -> debug
- app.py: retry stream proxy up to 3 times with port increment on failure
- server.py: add STREAM_PORT_ACTUAL global
If Camoufox fails to output WebSocket endpoint within timeout, kill the
process and retry up to 3 times with 3s delay between attempts.
Previous retry attempts all failed because the killed process hadn't
released port 9231 yet. Each retry now uses port+attempt to avoid conflict.
- _adjust_google_search: try JS label click as fallback when force click fails
- _adjust_stop_sequences: click input before fill/press to ensure focus
… for Camoufox

- Google Search toggle: scroll_into_view_if_needed before click
- Stop sequence input: scroll_into_view_if_needed before click
- Camoufox: find free port on every attempt (not just retries)
- Break immediately on EADDRINUSE instead of waiting full 90s timeout
- Use 127.0.0.1 bind and SO_REUSEADDR=0 for more accurate port availability check
- Increase max_tries to 20 to skip wider reserved port ranges
type() simulates keystrokes which causes decimal point to be ignored
in number inputs (e.g. '1.0' -> '10' -> clamped to max '2').
fill() sets value directly, avoiding this issue.
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.

1 participant