[Bug]: preview_evaluate accepts returnByValue:false but returns no usable object reference
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 70/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- electron, typescript
- Domain
- backend-api-design
Research direction
Read the returnByValue contract in packages/contracts/src/previewAutomation.ts and the result mapping in apps/server/src/preview/ServerBrowserPage.ts. Compare the Runtime.evaluate behavior for false and true, then check the existing preview automation tests for coverage. Done when false either returns a usable remote object reference or is explicitly rejected, while default and true still return object contents.
Written by the indexing model from the issue text.
Description
Written by human: this is possibly the lowest-priority issue I've ever opened. I seriously doubt anybody has ever actually encountered this problem naturally, but because it was mentioned once, my clankers keep bugging me to get this one fixed. IMO, the right solution is just to reject returnByValue:false altogether and close this out.
Written by AI:
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
packages/contracts or packages/shared
Steps to reproduce
-
Open a fresh blank preview tab in T3 Code Desktop:
preview_open({ profileId: "incognito", reuseExistingTab: false, open: true, show: true }) -
Retain its tab ID and evaluate an object with non-by-value mode:
preview_evaluate({ tabId, expression: "({ alpha: 1, href: location.href })", returnByValue: false }) -
Repeat with
returnByValue:true. -
Repeat with
returnByValueomitted.
Expected behavior
Either return a usable remote-object reference, as the contract describes, or explicitly reject the unsupported false option.
Default and explicit by-value evaluation should continue returning object contents.
Actual behavior
returnByValue:false succeeds but returns only:
{"value":"Object"}
There is no object handle or content in the result.
The same expression with returnByValue:true returns:
{"value":{"alpha":1,"href":"about:blank"}}
Default by-value evaluation also works. The behavior reproduced repeatedly, on both a blank page and a locally served static page.
The original generic execution error from #3716 did not reproduce. This report concerns the remaining contract mismatch.
Impact
Minor bug or occasional failure
Version or commit
main @ 680152e27b2a961686389ca69a1557cbb2c55f08
Environment
Linux x86_64; Electron 44.9.3; Chromium 152.0.7977.167; Codex provider through T3 Code.
Logs or stack traces
No exception is returned.
The contract describes `returnByValue` as:
> Serialize and return the value instead of a remote object reference. Defaults to true.
https://github.com/pingdotgg/t3code/blob/680152e27b2a961686389ca69a1557cbb2c55f08/packages/contracts/src/previewAutomation.ts#L622
The server forwards the option to `Runtime.evaluate`, then maps the result to its value or description. The remote object ID is not returned:
https://github.com/pingdotgg/t3code/blob/680152e27b2a961686389ca69a1557cbb2c55f08/apps/server/src/preview/ServerBrowserPage.ts#L851
Screenshots, recordings, or supporting files
No response
Workaround
Omit returnByValue or set it to true when inspecting serializable values.
Related issues
Focused follow-up requested in the closing comment on #3716:
https://github.com/pingdotgg/t3code/issues/3716#issuecomment-6314979496
Explicitly rejecting false would resolve this report without requiring a new remote-object manipulation feature.
Investigated and drafted by GPT-6.1-Sol through the Codex harness in T3 Code.
- Dominant language
- TypeScript
- Stars
- 24.8k
- Forks
- 6.4k
- Avg merge
- 3h 39m
- Merged PRs (30d)
- 301
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pingdotgg/t3code
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
pingdotgg/t3code#22819 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
bug needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
All issues in pingdotgg/t3code
Similar issues
-
[BUG] rag: sentence content can cross the reported sentence boundariesPossibly taken @LJK-ikun claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
README: the Resource URI Schemas example's file://documents/* pattern only matches that literal URIOpen
Difficulty 1/5 Under an hour Newbie friendliness 88/100
platformatic/mcp#361 ·
Maintainers usually reply within 1 day
-
frontend
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Push: sem service worker ou sem VAPID, o interruptor de Notificações fica ligado sem avisar nadaOpen
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
melgarafael/DeskcommCRM#3164 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
ant-design/pro-components#9769 ·
Maintainers usually reply within 1 day