AGENTS.md instructions for /Users/tanishqpalandurkar/Projects/yyork <INSTRUCTIONS>…
- User
AGENTS.md instructions for /Users/tanishqpalandurkar/Projects/yyork
--- project-doc ---
Agent workflow
- User will assign one PRD at a time to an agent to implement. All the PRDs are available in the
./prdsdir. - At any time if you think you could do a better job if a CLI tool was available to you and it would take you lesser tokens to do the task in presence of that tool, explicitly ask user to install it. Do not install it directly on your own as there are security related issues regarding this way of installation.
- User will assign one PRD at a time to an agent to implement. All the PRDs are available in the
- User
<environment_context> /Users/tanishqpalandurkar/Projects/yyork zsh <current_date>2026-06-09</current_date> Asia/Kolkata <workspace_roots>/Users/tanishqpalandurkar/Projects/yyork</workspace_roots><permission_profile type="disabled"><file_system type="unrestricted" /></permission_profile> </environment_context>
- User
Context from my IDE setup:
Active file: package.json
Open tabs:
- package.json: package.json
- portless.json: portless.json
- dashboard.go: dashboard.go
- .gitkeep: cmd/yyork/dashboard/.gitkeep
- .gitignore: .gitignore
My request for Codex:
https://https-yyork-localhost-preview.yyork.localhost/terminal/5pcyw3
why does yyork's preview url has this:
https-prefix?I was also thinking about what if there are 2 agents working on diff worktrees, made some changes and user would like to see the preview of the code changes. What it would do?
so for that something like
https://{sessionId}-{projectName}-preview.yyork.localhostwould be awesome and distinguishing enough. - Assistant
I’ll trace where that preview host is constructed and how portless is interpreting it, then I’ll separate confirmed behavior from the naming/design implication for multiple worktrees.
- Assistant
I found the relevant server path:
POST /api/browser-preview/targetsregisters a synthetic*-preview.yyork.localhosthost, and the current suspicious name looks generated from the target origin rather than a session-specific identity. I’m reading that host builder now. - Assistant
The
https-itself is not Portless adding a protocol marker to the public host. In yyork’s code it is the fallback slug produced bybrowserPreviewHostForOrigin: scheme plus normalized host, sohttps://yyork.localhostbecomeshttps-yyork-localhost-preview.yyork.localhostwhen no usable preview name/self-preview shortcut wins. - Assistant
There’s also a front-end detail: the Browser panel only sends
previewName={projectName}today. It does not send the selectedsessionId, even though preview URL preferences are already scoped byprojectId + sessionId. - Assistant
The PRD note matches the code’s intended behavior: named project previews should use
appname-preview.yyork.localhost; yyork self-preview should useyyork-preview.yyork.localhost. So the exact URL you pasted suggests the request path skipped both of those named cases and fell back to origin-based slugging. - Assistant
The dev stack currently registers only one Portless alias for preview traffic:
yyork-preview.yyork -> backend port. That means every*-preview.yyork.localhosthost depends on Portless wildcard/subdomain routing reaching yyork’s backend, while yyork keeps the per-host target mapping in memory. - Assistant
For two agents on different worktrees, the current storage model is already per session, but the proxy host name is not. If both sessions send the same project name and the same upstream origin, yyork can end up reusing the same preview host label and just overwrite the in-memory target for that host.
- Assistant
I’m checking how the selected Canvas target is assembled. That determines whether the project name or session id is actually available at the point where the Browser tab registers the proxy host.
- Assistant
At this point the root cause is clear enough for an answer, but I’m doing one more pass over the layout assembly so I can say exactly what field would need to change for your proposed
{sessionId}-{projectName}-previewshape. - Assistant
One subtlety: with the current Go code,
https://yyork.localhost/...with nopreviewNameshould still becomeyyork-preview.yyork.localhost. So your pastedhttps-yyork-localhost-preview...most likely means the browser registration sentpreviewName: "https://yyork.localhost"or equivalent, because explicit preview names take precedence over the self-preview shortcut. - Assistant
I’m not going to patch it unless you want that next; this turn reads like a design/root-cause question. I’ll give you the exact current behavior and the smallest code direction for the session-scoped hostname.
- Assistant
The
https-prefix comes from yyork’s fallback preview-host slugger, not from Portless. In internal/server/browser_preview.go,browserPreviewHostForOrigin()builds:text{scheme}-{normalized-host}-preview.yyork.localhost - User
tell me what's the reason that we need a fallback here?
- Assistant
The fallback exists because yyork’s Browser is not only for “selected yyork session preview.” It accepts any supported local URL the user types:
localhost,127.0.0.1:3000,foo.localhost, etc. If there is nopreviewName, yyork still needs a deterministic synthetic host so it can proxy and inject the preview bridge.So this path:
internal/server/browser_preview.go
does:
- Use explicit
previewNameif available. - Use
yyorkif the target is yyork itself. - Otherwise fall back to origin-derived host:
scheme-host-port-preview.yyork.localhost.
That fallback is also useful for local redirects. If a preview app redirects from one localhost origin to another, yyork can create a distinct preview host for that new origin instead of breaking the navigation.
The bug/design issue is not that fallback exists. It is that normal session previews should not land there, and they definitely should not use a protocol-looking slug as the user-facing identity. For session Browser tabs, the right fix is to pass a stable scoped preview name like so the fallback remains only for manual/unnamed local URLs and redirect cases.
- Use explicit
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.