talking-stick 0.4.5 → 0.4.6
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/dist/db.js +7 -0
- package/dist/service.js +28 -3
- package/docs/releases/0.4.6.md +20 -0
- package/package.json +1 -1
package/dist/db.js
CHANGED
|
@@ -114,6 +114,13 @@ const migrations = [
|
|
|
114
114
|
ALTER TABLE room_members ADD COLUMN harness_pid INTEGER;
|
|
115
115
|
ALTER TABLE room_members ADD COLUMN harness_process_started_at TEXT;
|
|
116
116
|
`
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
id: 7,
|
|
120
|
+
name: "room_member_last_park_hint_event_seq",
|
|
121
|
+
up: `
|
|
122
|
+
ALTER TABLE room_members ADD COLUMN last_park_hint_event_seq INTEGER;
|
|
123
|
+
`
|
|
117
124
|
}
|
|
118
125
|
];
|
|
119
126
|
export function resolveDatabasePath(options = {}) {
|
package/dist/service.js
CHANGED
|
@@ -665,6 +665,24 @@ export class TalkingStickService {
|
|
|
665
665
|
if (!room.owner && !room.reserved_for) {
|
|
666
666
|
const autoClaim = input.auto_claim ?? true;
|
|
667
667
|
if (!autoClaim) {
|
|
668
|
+
if (room.pending_handoff_event_seq) {
|
|
669
|
+
const member = this.getMember(input.room_id, input.agent_id);
|
|
670
|
+
const alreadyHinted = member?.last_park_hint_event_seq === room.pending_handoff_event_seq;
|
|
671
|
+
if (!alreadyHinted) {
|
|
672
|
+
this.recordParkHint(input.room_id, input.agent_id, room.pending_handoff_event_seq);
|
|
673
|
+
return {
|
|
674
|
+
status: "not_yet",
|
|
675
|
+
room_state: inspection.state,
|
|
676
|
+
turn_id: room.turn_id,
|
|
677
|
+
current_owner: room.owner ?? undefined,
|
|
678
|
+
reserved_for: room.reserved_for ?? undefined,
|
|
679
|
+
lease_expires_at: room.lease_expires_at ?? undefined,
|
|
680
|
+
claim_expires_at: room.claim_expires_at ?? undefined,
|
|
681
|
+
reason: "auto_claim_disabled",
|
|
682
|
+
hint: "A pending handoff is waiting in this idle room, but park mode does not auto-claim. Run `tt wait --json` to pick it up, or ask for an explicit assignment."
|
|
683
|
+
};
|
|
684
|
+
}
|
|
685
|
+
}
|
|
668
686
|
return {
|
|
669
687
|
status: "not_yet",
|
|
670
688
|
room_state: inspection.state,
|
|
@@ -672,9 +690,7 @@ export class TalkingStickService {
|
|
|
672
690
|
current_owner: room.owner ?? undefined,
|
|
673
691
|
reserved_for: room.reserved_for ?? undefined,
|
|
674
692
|
lease_expires_at: room.lease_expires_at ?? undefined,
|
|
675
|
-
claim_expires_at: room.claim_expires_at ?? undefined
|
|
676
|
-
reason: "auto_claim_disabled",
|
|
677
|
-
hint: "Idle room left unclaimed because park mode disables auto-claim. If work is pending, run `tt wait --json` or ask for an explicit assignment."
|
|
693
|
+
claim_expires_at: room.claim_expires_at ?? undefined
|
|
678
694
|
};
|
|
679
695
|
}
|
|
680
696
|
if (this.shouldDeferIdleClaim(room, input.agent_id, now)) {
|
|
@@ -1010,6 +1026,15 @@ export class TalkingStickService {
|
|
|
1010
1026
|
throw new ProtocolError("unknown_member", "Agent must join the room before using this tool.", { to_agent_id: agentId });
|
|
1011
1027
|
}
|
|
1012
1028
|
}
|
|
1029
|
+
recordParkHint(roomId, agentId, pendingHandoffEventSeq) {
|
|
1030
|
+
this.db
|
|
1031
|
+
.prepare(`
|
|
1032
|
+
UPDATE room_members
|
|
1033
|
+
SET last_park_hint_event_seq = ?
|
|
1034
|
+
WHERE room_id = ? AND agent_id = ?
|
|
1035
|
+
`)
|
|
1036
|
+
.run(pendingHandoffEventSeq, roomId, agentId);
|
|
1037
|
+
}
|
|
1013
1038
|
touchWaitingMember(roomId, agentId, timestamp) {
|
|
1014
1039
|
const result = this.db
|
|
1015
1040
|
.prepare(`
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Talking Stick 0.4.6
|
|
2
|
+
|
|
3
|
+
Date: 2026-05-12
|
|
4
|
+
|
|
5
|
+
## Added
|
|
6
|
+
- **`room_members.last_park_hint_event_seq`.** New nullable INTEGER column (migration 7) tracking which pending-handoff event sequence a member has already been hinted about via park mode. Used to give the `auto_claim_disabled` hint at most once per (member, pending handoff) pair.
|
|
7
|
+
|
|
8
|
+
## Fixed
|
|
9
|
+
- **Park no longer spins on truly idle rooms.** `tt wait --park` short-returns with `reason: auto_claim_disabled` and a hint only the first time a member parks against a given pending handoff in an idle room. Subsequent parks by the same member against the same pending handoff long-poll quietly. Truly idle (no pending handoff) always long-polls. A fresh pending handoff (newer event sequence) hints again, and each member is hinted independently. Previously the short-return fired on every park call, which kept a naive re-park loop spinning even after the agent saw the hint.
|
|
10
|
+
|
|
11
|
+
## Verification
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm run typecheck
|
|
15
|
+
npm test
|
|
16
|
+
npm run build
|
|
17
|
+
node dist/cli.js --help
|
|
18
|
+
git diff --check
|
|
19
|
+
npm pack --dry-run
|
|
20
|
+
```
|