GeezerVison is showing github.com — [Bug]: Linux AppImage: provider agent sessions still inherit LD_LIBRARY_PATH (bundled libnotify breaks notify-send) · Issue #28993 · pingdotgg/t3code
[Bug]: Linux AppImage: provider agent sessions still inherit LD_LIBRARY_PATH (bundled libnotify breaks notify-send) #28993DescriptionFollow-up to #16456, as requested there ("provider sessions still inherit the AppImage environment … open a new issue for that part only").
Area
apps/server (provider sessions)
What happens
On T3 Code nightly 0.1.7-nightly.20261101.4048 (AppImage, Arch Linux), shells started by Claude and Codex provider sessions inherit AppRun's environment, including:
LD_LIBRARY_PATH=/tmp/.mount_T3-CodXXXX/usr/lib:<the user's own entries>
APPDIR=/tmp/.mount_T3-CodXXXX
PATH=…:/tmp/.mount_T3-CodXXXX:/tmp/.mount_T3-CodXXXX/usr/sbin:…
XDG_DATA_DIRS=/tmp/.mount_T3-CodXXXX/usr/share/:…
GSETTINGS_SCHEMA_DIR=/tmp/.mount_T3-CodXXXX/usr/share/glib-2.0/schemas
The AppImage bundles an older libnotify.so.4, so any system tool an agent runs that links libnotify fails:
$ notify-send --version
notify-send: symbol lookup error: notify-send: undefined symbol: notify_notification_get_activation_app_launch_context
$ ldd /usr/bin/notify-send | grep notify
libnotify.so.4 => /tmp/.mount_T3-CodXXXX/usr/lib/libnotify.so.4
Scripts that send desktop notifications (for example, distro helper commands) break or abort under set -e when an agent runs them.
Expected
Provider sessions get the user's original environment: AppImage entries removed from LD_LIBRARY_PATH, PATH, XDG_DATA_DIRS and GSETTINGS_SCHEMA_DIR, and APPDIR/APPIMAGE/ARGV0/OWD unset. The user's own LD_LIBRARY_PATH entries are kept.
Steps to reproduce
- Launch the T3 Code AppImage on Linux.
- In a Claude or Codex thread, ask the agent to run
echo $LD_LIBRARY_PATH; notify-send --version.
Workaround
Strip $APPDIR/usr/lib from LD_LIBRARY_PATH in ~/.bashrc. That covers login shells, but Claude Code's per-command shell snapshot doesn't re-read .bashrc, so Claude sessions keep the bundled path.
Filed by Claude Opus 5.5 via Claude Code (in T3 Code). ActivityYamadaHideki commented on Nov 5, 2026 Still reproduces on a 0.1.7 build (cf45725e), on Arch Linux, with the AppImage extracted to a directory rather than mounted, and started through its AppRun.
APPDIR is unset in the Claude Code session, but the other three variables still point into the extracted tree:
LD_LIBRARY_PATH=~/.local/opt/t3code/<build>/usr/lib
GSETTINGS_SCHEMA_DIR=~/.local/opt/t3code/<build>/usr/share/glib-2.0/schemas
XDG_DATA_DIRS=~/.local/opt/t3code/<build>/usr/share/:…
notify-send fails with the same undefined symbol: notify_notification_get_activation_app_launch_context.
The failure is easy to misread in a project's own test suite. A test that runs notify-send and then waits for the notification on D-Bus hangs until its timeout. It prints no error, so it looks like a regression in the project. Running the suite under env -u LD_LIBRARY_PATH makes it pass. That points at the inherited path rather than the code. SusieeTheLinuxUser commented on Nov 6, 2026 The official AUR packages hit this too, in the integrated terminal as well as provider sessions, because APPDIR is never exported.
packaging/aur/t3code-nightly-bin/PKGBUILD (and t3code-bin) unpacks the AppImage to /opt/t3code-nightly-bin and installs this launcher:
#!/bin/sh
exec /opt/t3code-nightly-bin/AppRun "$@"
Without the AppImage runtime, AppRun computes APPDIR but doesn't export it. It does export LD_LIBRARY_PATH, PATH, XDG_DATA_DIRS and GSETTINGS_SCHEMA_DIR. stripAppImageRuntimeEnv in apps/server/src/terminal/Manager.ts returns early when neither APPIMAGE nor APPDIR is set, so the #3108 scrub never runs for AUR installs:
LD_LIBRARY_PATH=/opt/t3code-nightly-bin/usr/lib
GSETTINGS_SCHEMA_DIR=/opt/t3code-nightly-bin/usr/share/glib-2.0/schemas
PATH=…:/opt/t3code-nightly-bin:/opt/t3code-nightly-bin/usr/sbin:…
APPDIR unset
notify-send then fails with the same undefined symbol: notify_notification_get_activation_app_launch_context.
A one-line fix for the AUR side is to export it in the launcher:
exec env APPDIR=/opt/t3code-nightly-bin /opt/t3code-nightly-bin/AppRun "$@"
APPDIR is only read by that scrubber, so this shouldn't change anything else. Provider sessions would still need the fix this issue asks for.
Version: 0.1.8-nightly.20261106.4275 (t3code-nightly-bin), CachyOS.
Written with Claude Opus 5.5 via Claude Code (in T3 Code). cyppe commented on Nov 16, 2026 Still happening on 0.1.10-nightly.20261116.4774 (Arch, AUR t3code-nightly-bin, which extracts the AppImage to /opt/t3code-nightly-bin). Its launcher exports APPDIR=/opt/t3code-nightly-bin before running AppRun, and both the t3code server process and the Claude provider session have APPDIR set. The provider session still inherits all four AppRun variables unchanged:
LD_LIBRARY_PATH=/opt/t3code-nightly-bin/usr/lib
PATH=<first entry>:/opt/t3code-nightly-bin:/opt/t3code-nightly-bin/usr/sbin:…
XDG_DATA_DIRS=/opt/t3code-nightly-bin/usr/share/:…
GSETTINGS_SCHEMA_DIR=/opt/t3code-nightly-bin/usr/share/glib-2.0/schemas
The result is the same as in the report:
$ notify-send --version
notify-send: symbol lookup error: notify-send: undefined symbol: notify_notification_get_activation_app_launch_context
$ env -u LD_LIBRARY_PATH notify-send --version
notify-send 0.8.9
So exporting APPDIR isn't enough, at least for Claude provider sessions. I haven't checked T3's own terminals.
Workaround for extracted installs: start /opt/t3code-nightly-bin/t3code directly instead of through AppRun. Without the bundled path, ldd finds every library the binary needs on Arch. AppRun's only other job is adding --no-sandbox when unshare -Ur true fails. alanscodelog commented on Nov 16, 2026 I'm running on nix via a third-party flake and it hits this too, and like the AUR report it has no APPIMAGE or APPDIR, so stripAppImageRuntimeEnv in apps/server/src/terminal/Manager.ts returns early. The variables come from a nix makeBinaryWrapper launcher instead of AppRun, and the provider session sees 30 LD_LIBRARY_PATH entries against 0 in my real terminal.
I discovered this because a GTK app crashed from my terminal (bug in my app), but worked from T3's terminal! This was because T3's XDG_DATA_DIRS supplied a schema the app's own environment lacked. I then realized I had also run into this earlier. Agents kept complaining my electron apps would not run unless they unset ELECTRON_RUN_AS_NODE which was not an env variable I had set. I had not had time to investigate but it was this bug.
Now I know to watch out for it but very hard to catch for cases like this. 🫠
Version: 0.1.10-nightly.20261113.4643. RealDishwash commented on Nov 17, 2026 Another symptom of the leaked APPDIR, on KDE Plasma 6 (Wayland): GUI apps an agent starts show T3 Code's icon in the Plasma taskbar.
Repro: from a Claude session in the T3 Code AppImage, run flatpak run app.winters.octo (a Java app running through XWayland whose window class is java-util-concurrent-ForkJoinWorkerThread). The taskbar entry shows T3 Code's icon. The overview shows the right one.
The launched process inherits APPDIR=/tmp/.mount_t3_codXXXX. When Plasma's taskbar can't match a window to an app by its class, it falls back to the process's APPDIR and finds t3code.desktop there. Starting the same command with env -u APPDIR from the same session gives the correct icon, even with CHROME_DESKTOP and the T3CODE_* variables still set. So APPDIR alone causes this, and unsetting it as proposed above would fix it. graffhyrum commented on Nov 20, 2026 Follow-up from #39919 (closed in favor of this one) — consolidating here is fine, but the fix needs to cover two different leak vectors, and only one is on this thread so far.
1. The env leak reproduces on stable v0.1.11 AppImage (Linux x86_64): ELECTRON_RUN_AS_NODE=1, APPDIR=/tmp/.mount_…, APPIMAGE, OWD, and LD_LIBRARY_PATH carrying two mount paths, one from an earlier launch still mounted.
2. A second vector this thread doesn't cover: argv[0] of directly exec'd commands is the AppImage's own path.
bunx -e 'console.log(require("fs").readFileSync("/proc/self/cmdline","utf8"))'
# → "/home/<user>/Applications/T3 Code.AppImage\0-e\0<code>" — argv[0] is not "bunx"
bunx is a symlink to bun, and bun dispatches its bunx behavior on the invoked name — so under the shell tool, bunx <pkg> silently degrades to plain bun semantics: in a repo with a local tsc it runs the workspace TypeScript and silently ignores --package (wrong results with no error), and with no local bin it errors File not found instead of fetching. Same breakage for any argv0-dispatched multicall binary.
Why the argv symptom isn't just another leaked env var — the env scrub alone won't fix it:
ARGV0 is unset in the affected session while the mangling occurs,
- bun ignores
ARGV0 anyway: env ARGV0=bunx bun [email protected] hello still fails,
LD_PRELOAD is empty,
- any intermediary process execs cleanly from the same session —
bash -c 'bunx …', zsh -c '…', env -u ARGV0 bunx … all work; only execs performed directly by the session's shell get the rewritten argv[0].
So this is plausibly the same spawn layer (the apps/server/src/terminal/Manager.ts path referenced above), but the fix needs an argv assertion — child argv[0] = the command name or its resolved path — in addition to the env scrub. Suggested acceptance test: run bunx <pkg> from an agent session and assert the child's /proc/self/cmdline begins with the command name.
Happy to keep this consolidated here; #39919 can stay closed unless you'd rather track the argv vector separately.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|