@dmsdc-ai/aigentry-telepty 0.5.7 → 0.5.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/daemon.js +22 -2
- package/package.json +4 -4
- package/session-state.js +8 -0
package/daemon.js
CHANGED
|
@@ -1617,6 +1617,24 @@ function resolveSessionAlias(requestedId) {
|
|
|
1617
1617
|
return candidates[0];
|
|
1618
1618
|
}
|
|
1619
1619
|
|
|
1620
|
+
// #548 (alias-cascade shared-fate): resolveSessionAlias' most-recent-wins fuzzy match is correct for
|
|
1621
|
+
// READ/inject ("talk to the current `coder`"), but DESTRUCTIVE ops (DELETE / kill) must NEVER cascade
|
|
1622
|
+
// across distinct sids that merely share an alias. The incident: cleaning an already-gone `coder-532`
|
|
1623
|
+
// fuzzy-fell-through to its live sibling `coder-533` (same `coder` track) and KILLED it. Distinct sids
|
|
1624
|
+
// = distinct lifecycles. This resolver enforces "destroy exactly the session you named":
|
|
1625
|
+
// - exact sid match → that sid;
|
|
1626
|
+
// - a fully-qualified sid (ends in `-<digits>`) with no exact match → null (a stale/duplicate DELETE
|
|
1627
|
+
// of a gone sid must NOT fall through to a sibling — this is the exact #548 cascade);
|
|
1628
|
+
// - a bare alias → resolve ONLY when a single session carries it (unambiguous); multiple siblings → null
|
|
1629
|
+
// (refuse rather than silently pick most-recent and kill the wrong one).
|
|
1630
|
+
function resolveSessionForDestroy(requestedId) {
|
|
1631
|
+
if (sessions[requestedId]) return requestedId;
|
|
1632
|
+
if (/-\d+$/.test(requestedId)) return null;
|
|
1633
|
+
const baseAlias = requestedId.replace(/-\d+$/, '');
|
|
1634
|
+
const candidates = Object.keys(sessions).filter(id => id.replace(/-\d+$/, '') === baseAlias);
|
|
1635
|
+
return candidates.length === 1 ? candidates[0] : null;
|
|
1636
|
+
}
|
|
1637
|
+
|
|
1620
1638
|
app.post('/api/sessions/spawn', (req, res) => {
|
|
1621
1639
|
const { session_id, command, args = [], cwd = process.cwd(), cols = 80, rows = 30, type = 'AGENT' } = req.body;
|
|
1622
1640
|
if (!session_id) return res.status(400).json({ error: 'session_id is strictly required.' });
|
|
@@ -2823,7 +2841,8 @@ app.patch('/api/sessions/:id', (req, res) => {
|
|
|
2823
2841
|
|
|
2824
2842
|
app.post('/api/sessions/:id/kill', async (req, res) => {
|
|
2825
2843
|
const requestedId = req.params.id;
|
|
2826
|
-
|
|
2844
|
+
// #548: destructive op — must not cascade across alias-sharing siblings.
|
|
2845
|
+
const resolvedId = resolveSessionForDestroy(requestedId);
|
|
2827
2846
|
if (!resolvedId) return res.status(404).json({ error: 'Session not found', requested: requestedId });
|
|
2828
2847
|
|
|
2829
2848
|
try {
|
|
@@ -2852,7 +2871,8 @@ app.post('/api/sessions/:id/kill', async (req, res) => {
|
|
|
2852
2871
|
|
|
2853
2872
|
app.delete('/api/sessions/:id', (req, res) => {
|
|
2854
2873
|
const requestedId = req.params.id;
|
|
2855
|
-
|
|
2874
|
+
// #548: destructive op — must not cascade across alias-sharing siblings.
|
|
2875
|
+
const resolvedId = resolveSessionForDestroy(requestedId);
|
|
2856
2876
|
if (!resolvedId) return res.status(404).json({ error: 'Session not found', requested: requestedId });
|
|
2857
2877
|
const session = sessions[resolvedId];
|
|
2858
2878
|
const id = resolvedId;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dmsdc-ai/aigentry-telepty",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.8",
|
|
4
4
|
"main": "daemon.js",
|
|
5
5
|
"bin": {
|
|
6
6
|
"aigentry-telepty": "install.js",
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
],
|
|
36
36
|
"scripts": {
|
|
37
37
|
"postinstall": "node scripts/postinstall.js",
|
|
38
|
-
"test": "node --test test/auth.test.js test/http-auth.test.js test/daemon.test.js test/daemon-singleton.test.js test/integration/daemon-launch.test.js test/cli.test.js test/telepty-kill.test.js test/idle-ttl.test.js test/telepty-clean-older-than.test.js test/lifecycle-transport-agnostic.test.js test/skill-installer.test.js test/interactive-terminal.test.js test/runtime-info.test.js test/session-routing.test.js test/session-state.test.js test/session-store-persistence.test.js test/mailbox-lock.test.js test/report-enforcement.test.js test/enforce-report.test.js test/peer-inject-validator.test.js test/enforce-submit-gate.test.js test/submit-gate.test.js test/submit-via-pty.test.js test/prompt-symbol-registry.test.js test/inject-submit-flags.test.js test/inject-submit-force-env.test.js test/host-spec.test.js test/cross-host-inject.test.js test/cross-machine-ssh-routing.test.js test/init.test.js test/win-resolve-executable.test.js test/version-handshake.test.js test/win-kill-process.test.js test/daemon-control-port-owner.test.js test/banner-stderr-jq-safety.test.js test/bridge-supervisor-ipc.test.js test/bridge-j3-shim.test.js test/bridge-e2e.test.js test/release-0.4.5-bugfixes.test.js && git diff --exit-code tests/snippet-protocol/v1/",
|
|
39
|
-
"test:watch": "node --test --watch test/auth.test.js test/http-auth.test.js test/daemon.test.js test/daemon-singleton.test.js test/integration/daemon-launch.test.js test/cli.test.js test/telepty-kill.test.js test/idle-ttl.test.js test/telepty-clean-older-than.test.js test/lifecycle-transport-agnostic.test.js test/skill-installer.test.js test/interactive-terminal.test.js test/runtime-info.test.js test/session-routing.test.js test/session-state.test.js test/session-store-persistence.test.js test/mailbox-lock.test.js test/report-enforcement.test.js test/enforce-report.test.js test/peer-inject-validator.test.js test/enforce-submit-gate.test.js test/submit-gate.test.js test/submit-via-pty.test.js test/prompt-symbol-registry.test.js test/inject-submit-flags.test.js test/inject-submit-force-env.test.js test/host-spec.test.js test/cross-host-inject.test.js test/cross-machine-ssh-routing.test.js test/init.test.js test/win-resolve-executable.test.js test/version-handshake.test.js test/win-kill-process.test.js test/daemon-control-port-owner.test.js test/banner-stderr-jq-safety.test.js test/bridge-supervisor-ipc.test.js test/bridge-j3-shim.test.js test/bridge-e2e.test.js test/release-0.4.5-bugfixes.test.js",
|
|
40
|
-
"test:ci": "node --test --test-reporter=spec test/auth.test.js test/http-auth.test.js test/daemon.test.js test/daemon-singleton.test.js test/integration/daemon-launch.test.js test/cli.test.js test/telepty-kill.test.js test/idle-ttl.test.js test/telepty-clean-older-than.test.js test/lifecycle-transport-agnostic.test.js test/skill-installer.test.js test/interactive-terminal.test.js test/runtime-info.test.js test/session-routing.test.js test/session-state.test.js test/session-store-persistence.test.js test/mailbox-lock.test.js test/report-enforcement.test.js test/enforce-report.test.js test/peer-inject-validator.test.js test/enforce-submit-gate.test.js test/submit-gate.test.js test/submit-via-pty.test.js test/prompt-symbol-registry.test.js test/inject-submit-flags.test.js test/inject-submit-force-env.test.js test/host-spec.test.js test/cross-host-inject.test.js test/cross-machine-ssh-routing.test.js test/init.test.js test/win-resolve-executable.test.js test/version-handshake.test.js test/win-kill-process.test.js test/daemon-control-port-owner.test.js test/banner-stderr-jq-safety.test.js test/bridge-supervisor-ipc.test.js test/bridge-j3-shim.test.js test/bridge-e2e.test.js test/release-0.4.5-bugfixes.test.js && git diff --exit-code tests/snippet-protocol/v1/",
|
|
38
|
+
"test": "node --require ./test-support/setup-env.js --test test/auth.test.js test/http-auth.test.js test/daemon.test.js test/daemon-singleton.test.js test/integration/daemon-launch.test.js test/cli.test.js test/telepty-kill.test.js test/idle-ttl.test.js test/telepty-clean-older-than.test.js test/lifecycle-transport-agnostic.test.js test/skill-installer.test.js test/interactive-terminal.test.js test/runtime-info.test.js test/session-routing.test.js test/session-state.test.js test/session-store-persistence.test.js test/mailbox-lock.test.js test/report-enforcement.test.js test/enforce-report.test.js test/peer-inject-validator.test.js test/enforce-submit-gate.test.js test/submit-gate.test.js test/submit-via-pty.test.js test/prompt-symbol-registry.test.js test/inject-submit-flags.test.js test/inject-submit-force-env.test.js test/host-spec.test.js test/cross-host-inject.test.js test/cross-machine-ssh-routing.test.js test/init.test.js test/win-resolve-executable.test.js test/version-handshake.test.js test/win-kill-process.test.js test/daemon-control-port-owner.test.js test/banner-stderr-jq-safety.test.js test/bridge-supervisor-ipc.test.js test/bridge-j3-shim.test.js test/bridge-e2e.test.js test/release-0.4.5-bugfixes.test.js && git diff --exit-code tests/snippet-protocol/v1/",
|
|
39
|
+
"test:watch": "node --require ./test-support/setup-env.js --test --watch test/auth.test.js test/http-auth.test.js test/daemon.test.js test/daemon-singleton.test.js test/integration/daemon-launch.test.js test/cli.test.js test/telepty-kill.test.js test/idle-ttl.test.js test/telepty-clean-older-than.test.js test/lifecycle-transport-agnostic.test.js test/skill-installer.test.js test/interactive-terminal.test.js test/runtime-info.test.js test/session-routing.test.js test/session-state.test.js test/session-store-persistence.test.js test/mailbox-lock.test.js test/report-enforcement.test.js test/enforce-report.test.js test/peer-inject-validator.test.js test/enforce-submit-gate.test.js test/submit-gate.test.js test/submit-via-pty.test.js test/prompt-symbol-registry.test.js test/inject-submit-flags.test.js test/inject-submit-force-env.test.js test/host-spec.test.js test/cross-host-inject.test.js test/cross-machine-ssh-routing.test.js test/init.test.js test/win-resolve-executable.test.js test/version-handshake.test.js test/win-kill-process.test.js test/daemon-control-port-owner.test.js test/banner-stderr-jq-safety.test.js test/bridge-supervisor-ipc.test.js test/bridge-j3-shim.test.js test/bridge-e2e.test.js test/release-0.4.5-bugfixes.test.js",
|
|
40
|
+
"test:ci": "node --require ./test-support/setup-env.js --test --test-reporter=spec test/auth.test.js test/http-auth.test.js test/daemon.test.js test/daemon-singleton.test.js test/integration/daemon-launch.test.js test/cli.test.js test/telepty-kill.test.js test/idle-ttl.test.js test/telepty-clean-older-than.test.js test/lifecycle-transport-agnostic.test.js test/skill-installer.test.js test/interactive-terminal.test.js test/runtime-info.test.js test/session-routing.test.js test/session-state.test.js test/session-store-persistence.test.js test/mailbox-lock.test.js test/report-enforcement.test.js test/enforce-report.test.js test/peer-inject-validator.test.js test/enforce-submit-gate.test.js test/submit-gate.test.js test/submit-via-pty.test.js test/prompt-symbol-registry.test.js test/inject-submit-flags.test.js test/inject-submit-force-env.test.js test/host-spec.test.js test/cross-host-inject.test.js test/cross-machine-ssh-routing.test.js test/init.test.js test/win-resolve-executable.test.js test/version-handshake.test.js test/win-kill-process.test.js test/daemon-control-port-owner.test.js test/banner-stderr-jq-safety.test.js test/bridge-supervisor-ipc.test.js test/bridge-j3-shim.test.js test/bridge-e2e.test.js test/release-0.4.5-bugfixes.test.js && git diff --exit-code tests/snippet-protocol/v1/",
|
|
41
41
|
"typecheck": "tsc --noEmit",
|
|
42
42
|
"regen-fixtures": "node scripts/regen-snippet-fixtures.js"
|
|
43
43
|
},
|
package/session-state.js
CHANGED
|
@@ -96,6 +96,14 @@ const THINKING_PATTERNS = [
|
|
|
96
96
|
/\breading\b/i, // Claude Code "Reading..."
|
|
97
97
|
/\bsearching\b/i, // Claude Code "Searching..."
|
|
98
98
|
/\bplanning\b/i, // Claude Code "Planning..."
|
|
99
|
+
// codex CLI active-work markers (#558): codex emits NO braille spinner and NO OSC 133, so its
|
|
100
|
+
// "busy" state went unrecognized → blank sidebar pill. These are high-signal codex/claude markers
|
|
101
|
+
// shown ONLY while actively generating/running tools. ("Working" is intentionally NOT matched —
|
|
102
|
+
// it false-positives on common dev output like "working tree" / "working directory".)
|
|
103
|
+
/\besc to interrupt\b/i, // codex + claude: shown only during active generation / tool run
|
|
104
|
+
/\bstarting mcp servers?\b/i,// codex: MCP bootstrap on launch
|
|
105
|
+
/\bbooting mcp server\b/i, // codex: MCP server boot
|
|
106
|
+
/\bexploring\b/i, // codex activity verb (parallels Claude Code "Searching")
|
|
99
107
|
/\.{3,}\s*$/, // trailing dots "..."
|
|
100
108
|
];
|
|
101
109
|
|