Feat: introduce lux models for agent#1453
Conversation
|
There was a problem hiding this comment.
No issues found across 8 files
Architecture diagram
sequenceDiagram
participant User as "Client Code"
participant Factory as "AgentProvider"
participant NewClient as "OpenAGICUAClient"
participant OAGI as "@oagi/oagi SDK"
participant API as "OpenAGI API"
participant Browser as "Browser/Page"
Note over User,Factory: Initialization Phase
User->>Factory: stagehand.agent({ mode: 'cua', model: 'openagi/lux-actor-1' })
Note right of Factory: CHANGED: Switch on 'openagi' provider
alt Provider == 'openagi'
Factory->>NewClient: NEW: instantiate(modelName, options)
NewClient-->>Factory: client instance
else Provider == 'anthropic' / 'openai' / etc
Factory->>Factory: Instantiate existing clients
end
Factory-->>User: agent instance
Note over User,Browser: Execution Phase (Computer Use Loop)
User->>NewClient: act('Book a flight...')
loop Action Cycle
NewClient->>Browser: Capture State (Screenshot/DOM)
Browser-->>NewClient: state data
NewClient->>OAGI: NEW: client.step(state, instructions)
OAGI->>API: Network Request (lux-actor-1)
API-->>OAGI: Agent Actions (Click, Type, Scroll, etc.)
OAGI-->>NewClient: Response Object
Note over NewClient: NEW: Action Translation Layer
alt Has Pending Actions
NewClient->>NewClient: Map OpenAGI action to Stagehand/Playwright
NewClient->>Browser: Execute Action (e.g., click(x,y))
else Task Complete
NewClient-->>User: Return Result
end
end
Greptile Summary
Important Files Changed
Confidence score: 4/5
Sequence DiagramsequenceDiagram
participant User
participant Stagehand
participant Agent
participant OpenAGICUAClient
participant OpenAGIAPI
participant Browser
User->>Stagehand: "new Stagehand({ mode: 'cua', model: 'openagi/lux-actor-1' })"
Stagehand->>Agent: "stagehand.agent(config)"
Agent->>OpenAGICUAClient: "new OpenAGICUAClient(modelName, clientOptions)"
User->>Agent: "agent.execute(instruction)"
Agent->>OpenAGICUAClient: "execute(executionOptions)"
loop "For each step (up to maxSteps)"
OpenAGICUAClient->>Browser: "captureScreenshot()"
Browser-->>OpenAGICUAClient: "base64 screenshot"
OpenAGICUAClient->>OpenAGIAPI: "actor.step(screenshot)"
OpenAGIAPI-->>OpenAGICUAClient: "step result with actions"
OpenAGICUAClient->>OpenAGICUAClient: "convertAction(step, action)"
OpenAGICUAClient->>Browser: "execute converted action"
end
OpenAGICUAClient-->>Agent: "AgentResult"
Agent-->>User: "execution result"
|
There was a problem hiding this comment.
Additional Comments (1)
-
packages/core/lib/v3/agent/AgentProvider.ts, line 97-103 (link)logic: The OpenAGI client constructor call is missing the
toolsparameter that other CUA clients receive (see lines 72, 80, and 88)
7 files reviewed, 1 comment
why
what changed
OpenAGICUAClient.tscua-example.tsto usemode: cuato avoidERROR: [DEPRECATED] The "cua: true" option is deprecated. Use "mode: 'cua'" instead. This option will be removed in a future version.test plan
cua-example.ts: change the model name toopenagi/lux-actor-1, use an api key from openagipnpm run example cua-exampleSummary by cubic
Adds OpenAGI computer-use agent support with lux-actor-1 and lux-thinker-1, enabling tasks to run via OpenAGI. Updates agent provider mapping, public types, and the example to use mode: "cua".
New Features
Migration
cua: truewithmode: "cua"in agent config.setScreenshotProviderif your runtime doesn’t supply one.Written for commit efdc88e. Summary will update automatically on new commits.