Skip to content

fix: use client host env in workspace block for managed daemons#24420

Merged
noanflaherty merged 2 commits into
mainfrom
do/fix-host-env-transport-hint
Apr 8, 2026
Merged

fix: use client host env in workspace block for managed daemons#24420
noanflaherty merged 2 commits into
mainfrom
do/fix-host-env-transport-hint

Conversation

@noanflaherty
Copy link
Copy Markdown
Contributor

@noanflaherty noanflaherty commented Apr 8, 2026

Summary

  • The <workspace> block renderer was calling os.homedir() / os.userInfo().username directly, which returns the container's values for platform-managed (hosted) daemons. The hostHomeDir/hostUsername fields plumbed through MacosTransportMetadata by fix: pass transport hints through HTTP message endpoint for managed-mode conversations #23824 were stored but never read, so managed assistants saw the container home dir and hallucinated user-facing paths like /Users/marina/Desktop/test.txt from the user's display name.
  • Unify the rendering path: store client-reported host env on Conversation from applyTransportMetadata (and the queue-drain path), expose it via WorkspaceConversationContext, and have renderWorkspaceTopLevelContext prefer those values with os.homedir() / os.userInfo().username as a fallback for non-macOS / server-initiated paths.
  • Invalidate the workspace top-level cache only when the host env values actually change, so we re-render the block on first-set without thrashing on every message.

Original prompt

it


Open with Devin

chatgpt-codex-connector[bot]

This comment was marked as resolved.

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 4 additional findings.

Open in Devin Review

Addresses Codex review feedback: when a conversation is reused across
interfaces (macOS → iOS/CLI/channels), previously-stored macOS host env
values were sticking around and leaking stale Mac paths into the
<workspace> block on later non-macOS turns. Clear hostHomeDir and
hostUsername when transport is non-macOS so the renderer falls back to
the daemon's own os.homedir() / os.userInfo().username. Mirror the fix
in both applyTransportMetadata and the queue-drain path.
@noanflaherty
Copy link
Copy Markdown
Contributor Author

@codex review this PR again — the previous issues have been fixed in commit 62e8c56

@noanflaherty
Copy link
Copy Markdown
Contributor Author

@devin review this PR again — the previous issues have been fixed in commit 62e8c56

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 0 new potential issues.

View 3 additional findings in Devin Review.

Open in Devin Review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

ℹ️ 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".

@noanflaherty noanflaherty merged commit 4d179ee into main Apr 8, 2026
10 checks passed
@noanflaherty noanflaherty deleted the do/fix-host-env-transport-hint branch April 8, 2026 20:24
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