Skip to content

Fix AttributeError crash from calling nonexistent warning method on StagehandLogger#320

Merged
tkattkat merged 1 commit intov0from
fix--address-logging-issues
Mar 17, 2026
Merged

Fix AttributeError crash from calling nonexistent warning method on StagehandLogger#320
tkattkat merged 1 commit intov0from
fix--address-logging-issues

Conversation

@tkattkat
Copy link
Contributor

@tkattkat tkattkat commented Mar 17, 2026

Fix AttributeError crash from calling nonexistent warning method on StagehandLogger

  • replaced .warning calls with .debug

Summary by cubic

Fixed a crash caused by calling a nonexistent warning method on StagehandLogger. Replaced those calls with debug to prevent AttributeError during CDP setup, page injection, and context cleanup.

Written for commit fe21ee2. Summary will update on new commits. Review in cubic

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.
Architecture diagram
sequenceDiagram
    participant S as Stagehand Core
    participant C as Browser Context
    participant P as Stagehand Page
    participant L as StagehandLogger
    participant API as Browserbase API

    Note over S, L: Initialization & CDP Setup
    S->>S: init()
    alt CDP Download Setup Fails
        S->>L: CHANGED: debug("Failed to set up CDP...")
    end

    Note over P, L: Page Injection (Navigation/Lifecycle)
    P->>P: ensure_injection()
    alt TargetClosedError (Page Navigating/Closed)
        P->>L: CHANGED: debug("ensure_injection failed...", category="page")
    end

    Note over C, L: Context & Session Cleanup
    C->>C: handle_with_lock() (Cleanup remaining pages)
    opt Page Wrapper missing
        C->>L: CHANGED: debug("Could not find StagehandPage...", category="context")
    end

    S->>S: close()
    alt HTTP Client unavailable for Session Close
        S->>L: CHANGED: debug("Cannot end server session...")
    else Success path
        S->>API: DELETE /sessions/{id}
    end
Loading

@tkattkat tkattkat merged commit 32bc2da into v0 Mar 17, 2026
3 checks passed
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