fix(gateway): honor browser profile from request body for node proxy calls#28852
Conversation
Greptile SummaryFixes gateway browser proxy to correctly read Confidence Score: 5/5
Last reviewed commit: 98bf9a8 |
nikolasdehor
left a comment
There was a problem hiding this comment.
The code change is correct — query-first precedence maintains backward compat, trim() prevents whitespace-only strings. Missing: tests and a proper PR description for review traceability.
…calls Gateway browser.request only read profile from query.profile before invoking browser.proxy on nodes. Calls that passed profile in POST body silently fell back to the default profile, which could switch users into chrome extension mode even when they explicitly requested openclaw profile. Use query profile first, then fall back to body.profile when present. Closes openclaw#28687
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
5 similar comments
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
Summary
profilefrom query params, so calls that passprofilein POST body silently lose it.profile: "openclaw"can be ignored and fall back to default profile (chrome), causing wrong runtime mode and startup errors.resolveRequestedProfile()insrc/gateway/server-methods/browser.tsto resolve profile fromquery.profilefirst, then fallback tobody.profile.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
profilein POST body now correctly honor that profile.profilepassed in query remains the highest-priority source.Security Impact (required)
NoNoNoNoNoRepro + Verification
Environment
Steps
profile: "openclaw"and noquery.profile.Expected
profile: "openclaw".Actual
profilewasundefinedunless put in query.profileresolved from body when query does not provide it.Evidence
Type-check passed after change:
pnpm -C /Users/sidqin/Desktop/openclaw-contrib exec tsc --noEmit --pretty falseCore change in
src/gateway/server-methods/browser.ts:profile: typeof query?.profile === "string" ? query.profile : undefinedprofile: resolveRequestedProfile({ query, body })Human Verification (required)
Compatibility / Migration
YesNoNoFailure Recovery (if this breaks)
src/gateway/server-methods/browser.tsRisks and Mitigations
Low risk. Change is scoped to parsing profile input and keeps query precedence unchanged.