Skip to content

Allow fetching id within constructor#2786

Open
afsalthaj wants to merge 5 commits intomainfrom
fix_id
Open

Allow fetching id within constructor#2786
afsalthaj wants to merge 5 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

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.

ts-sdk: getting phantom id inside constructor traps

3 participants