Skip to content

fix(edge): drop selectWidget from the hosted router catalog#27

Merged
ElbertePlinio merged 2 commits into
mainfrom
fix/hosted-selectwidget
Jul 10, 2026
Merged

fix(edge): drop selectWidget from the hosted router catalog#27
ElbertePlinio merged 2 commits into
mainfrom
fix/hosted-selectwidget

Conversation

@ElbertePlinio

Copy link
Copy Markdown
Member

Refs pickforge/pickforge#192, pickforge/pickforge#191.

The hosted operator-router system prompt listed selectWidget, so the hosted model could propose it for a command like "select the login button" — the app then can't fulfill it (semantic widget matching has no hosted endpoint yet) but the routing credit was already spent. This trims selectWidget from the hosted catalog and tells the model to treat on-screen selection as unclear, so hosted never charges for an action it can't complete. The full hosted widget-match endpoint remains tracked in #192.

Patch release 0.7.1 (lockstep).

Tested

  • bun run check — 221 tests pass (incl. new assertion the prompt omits selectWidget), typecheck + coverage + build green.

Not tested

  • No live hosted model call (owner OAuth smoke).

Risk

  • Low: prompt-only change; the RouterProposal schema still accepts selectWidget for BYO/local routing.

Semantic widget selection has no hosted endpoint yet, so the hosted
model must not propose selectWidget — it would charge a routing credit
for an action the app can only decline. Instruct the model to treat
on-screen selection requests as unclear instead. Bump to 0.7.1.
@ElbertePlinio

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2e66fca788

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

"- enterSelectMode: {\"action\":\"enterSelectMode\"}.",
"- takeScreenshot: {\"action\":\"takeScreenshot\"}.",
"- selectWidget: {\"action\":\"selectWidget\",\"description\":string}.",
"Semantic widget selection is not available over hosted routing; treat any request to select or click an on-screen element as unclear.",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Update the deployed router import map

When the Supabase operator-router function is deployed, supabase/functions/operator-router/index.ts imports @pickforge/edge-shared through supabase/functions/operator-router/deno.json, which is still pinned to npm:@pickforge/[email protected] on line 5. Because this commit only changes the package source/version, the hosted router will continue loading the old 0.7.0 prompt that still advertises selectWidget, so click/select requests keep producing the action this change is trying to suppress after a normal deploy. Please bump the function import map to 0.7.1 (or otherwise make the function consume this local package update).

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed — both operator-router and create-credit-checkout deno.json now pin @pickforge/[email protected]; I'll redeploy operator-router after 0.7.1 publishes so the catalog trim takes effect live.

@ElbertePlinio

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2a72fc33e3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

"- enterSelectMode: {\"action\":\"enterSelectMode\"}.",
"- takeScreenshot: {\"action\":\"takeScreenshot\"}.",
"- selectWidget: {\"action\":\"selectWidget\",\"description\":string}.",
"Semantic widget selection is not available over hosted routing; treat any request to select or click an on-screen element as unclear.",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid charging unsupported widget-selection routes

For commands like "click the login button", this new instruction makes the hosted model return an unclear proposal, but createOperatorRouterHandler still debits after every successful completion before returning the proposal. Because that path is still a 200 response with stored metadata, users still spend the routing credit for the unsupported widget-selection request; this only stops the selectWidget action from being proposed, not the hosted-charge problem the change is meant to avoid.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Intentional — hosted routing is metered per model call, so an 'unclear' result is still a real model invocation and is billed like any other route. The app now shows this honestly ('routed · 1¢ · unclear'), and the ladder tries deterministic + BYO first (both free) before hosted ever runs. Making widget-ish commands free isn't feasible (the app can't classify a command as widget-selection before the model runs) and would open a free-routing loophole (any command could be phrased to return 'unclear'). #27's scope was to stop the model proposing an action the app can't fulfill (the charge-then-fail bug), which it does; charging for the model call itself is the correct billing model.

@ElbertePlinio ElbertePlinio merged commit 2bca736 into main Jul 10, 2026
1 check passed
@ElbertePlinio ElbertePlinio deleted the fix/hosted-selectwidget branch July 10, 2026 04:43
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