Skip to content

Allow fetching id within constructor#2786

Merged
vigoo merged 6 commits intomainfrom
fix_id
Mar 11, 2026
Merged

Allow fetching id within constructor#2786
vigoo merged 6 commits intomainfrom
fix_id

Conversation

@afsalthaj
Copy link
Contributor

@afsalthaj afsalthaj commented Feb 17, 2026

Fixes #2781

image

phantomId was failing because it delegates back to agentId. Fixed the issue, and now we can refer ids within constructor.

image

@afsalthaj afsalthaj marked this pull request as draft February 17, 2026 08:32
@afsalthaj afsalthaj marked this pull request as ready for review February 17, 2026 08:40
Copy link
Contributor

@mschuwalow mschuwalow left a comment

Choose a reason for hiding this comment

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

Can confirm it works. A regression test would be nice though

@vigoo
Copy link
Contributor

vigoo commented Feb 17, 2026

I would like to understand this before it gets merged (what is it fixing, and why - I thought that method is just a placeholder for IDE compeltion).
Also I'd just use a global variable not a new class. Let's try to keep the sdk as slim as possible.

@mschuwalow
Copy link
Contributor

The problem was that patching the placeholder was done only after the constructor was called. Meaning using getAgentId / getPhantomId in the constructor would trap.

@afsalthaj
Copy link
Contributor Author

Ok, this was never merged for a while, and the tests are failing too (which I am a bit surprised). I will take a look

@vigoo vigoo merged commit e00a1dc into main Mar 11, 2026
27 checks passed
@vigoo vigoo deleted the fix_id branch March 11, 2026 14:47
@github-actions github-actions bot locked and limited conversation to collaborators Mar 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ts-sdk: getting phantom id inside constructor traps

3 participants