Skip to content

Commit 91ebb44

Browse files
committed
feat: support elevated Windows Terminal profile
1 parent 73f262a commit 91ebb44

3 files changed

Lines changed: 70 additions & 0 deletions

File tree

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Thread name storage investigation
2+
3+
## Goal
4+
5+
Check whether `codex-tabs` can display the Codex thread name created with `/rename thread` without scanning every transcript on every render.
6+
7+
## What was checked
8+
9+
- `threads.title` in `~/.codex/state_5.sqlite`
10+
- the rest of the `threads` table columns
11+
- other local state tables in `~/.codex/state_5.sqlite`
12+
- `~/.codex/history.jsonl`
13+
- the per-session JSONL transcript under `~/.codex/sessions/`
14+
15+
## Findings
16+
17+
- The only obvious user-facing thread-name field in the local state DB is `threads.title`.
18+
- On this machine, `threads.title` still matches `first_user_message` even after using `/rename thread`.
19+
- Other local tables did not expose an alternative persisted thread-name field.
20+
- The session transcript JSONL contains structured events such as `session_meta`, `user_message`, `agent_message`, and tool calls, but no cheap standalone persisted field for the renamed thread name was identified.
21+
22+
## Conclusion
23+
24+
At the time of this investigation, Codex thread names created with `/rename thread` were not exposed in a cheap local field that `codex-tabs` could read directly.
25+
26+
## Decision
27+
28+
Do not add `thread name:` to the UI yet.
29+
30+
Parsing transcripts to recover rename commands was considered too costly for the normal display path.
31+
32+
## Related context
33+
34+
- Codex upstream clearly has a thread-naming concept.
35+
- The missing piece is a reliable local field or documented storage location that `codex-tabs` can read cheaply.

src/codex_tabs/launchers.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ def open_named_sessions(
3232
selected,
3333
codex_bin=codex_bin,
3434
distro=os.environ.get("WSL_DISTRO_NAME", "Ubuntu"),
35+
profile=os.environ.get("CODEX_TABS_WT_PROFILE"),
3536
window=window,
3637
fallback_cwd=os.getcwd(),
3738
)
@@ -173,6 +174,7 @@ def build_wt_command(
173174
*,
174175
codex_bin: str,
175176
distro: str,
177+
profile: str | None,
176178
window: str,
177179
fallback_cwd: str,
178180
) -> list[str]:
@@ -194,6 +196,17 @@ def build_wt_command(
194196
"new-tab",
195197
"--title",
196198
entry.name,
199+
]
200+
)
201+
if profile:
202+
wt_parts.extend(
203+
[
204+
"-p",
205+
profile,
206+
]
207+
)
208+
wt_parts.extend(
209+
[
197210
"wsl.exe",
198211
"-d",
199212
distro,

tests/test_launchers.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ def test_build_wt_command_for_two_sessions(self) -> None:
2525
entries,
2626
codex_bin="/usr/bin/codex",
2727
distro="Ubuntu",
28+
profile=None,
2829
window="last",
2930
fallback_cwd="/tmp",
3031
)
@@ -50,13 +51,34 @@ def test_build_wt_command_for_new_window_omits_window_flag(self) -> None:
5051
entries,
5152
codex_bin="/usr/bin/codex",
5253
distro="Ubuntu",
54+
profile=None,
5355
window="new",
5456
fallback_cwd="/tmp",
5557
)
5658

5759
self.assertEqual(cmd[0], "wt.exe")
5860
self.assertNotIn("-w", cmd)
5961

62+
def test_build_wt_command_with_profile(self) -> None:
63+
entries = [
64+
SessionEntry(
65+
name="personal",
66+
session_id="01234567-89ab-cdef-0123-456789abcdef",
67+
)
68+
]
69+
70+
cmd = build_wt_command(
71+
entries,
72+
codex_bin="/usr/bin/codex",
73+
distro="Ubuntu",
74+
profile="Ubuntu (Admin)",
75+
window="last",
76+
fallback_cwd="/tmp",
77+
)
78+
79+
self.assertIn("-p", cmd)
80+
self.assertIn("Ubuntu (Admin)", cmd)
81+
6082
def test_build_tmux_commands_for_new_session(self) -> None:
6183
entries = [
6284
SessionEntry(

0 commit comments

Comments
 (0)