Skip to content

AI streaming failed: prompt is too long: 201866 tokens > 200000 maximum #10

Description

@codebanesr

Prompt:

ok... goto wikipedia search for istanbul, there is a link for transportation, click it, then summarize ferry system

Error

[1] 🔍 No existing browser found, will launch local browser
[1] Browser action error: TypeError: page2.waitForTimeout is not a function
[1]     at Object.execute (/Users/shanurrahman/Documents/hivelogic/terminator/backend/src/services/tools/categories/browser-automation.ts:151:24)
[1]     at async <anonymous> (/Users/shanurrahman/Documents/hivelogic/terminator/backend/node_modules/ai/core/telemetry/record-span.ts:18:22)
[1] 🌐 Browser action: extract
[1] 🔍 No existing browser found, will launch local browser
[1] 🎯 Getting clickable elements from page
[1] AI generation error: Error: AI streaming failed: prompt is too long: 201866 tokens > 200000 maximum
[1]     at AIService.streamResponse (/Users/shanurrahman/Documents/hivelogic/terminator/backend/src/services/AIService.ts:189:13)
[1]     at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
[1]     at async Socket.<anonymous> (/Users/shanurrahman/Documents/hivelogic/terminator/backend/src/services/SocketService.ts:154:30)

Reason:
Because we are not using vision, browser use ended up reading all the clickable elements and this wiki page has tons of them.

Solution:
Enable vision mode, both claude and gemini support it

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions