feat: Enter answers a blocked agent with hc send --force (never from the queue)
Co-Authored-By: Ovis Fast (Claude) <[email protected]>
This commit is contained in:
1 parent
3b7b4618a3
commit
d852c406dd
3 files changed
+46
-7
No files matched your search
@@ -1021,7 +1021,10 @@ export default class Composer extends View {
|
||||
this.draining.has(key) ||
|
||||
(mode !== "now" && (this.state.queue[key] ?? []).some((entry) => entry.state === "countdown"));
|
||||
if (decision.kind === "send" && allowed && !busy) {
|
||||
this.sendNow(agent, message, cx);
|
||||
// The person's own Enter answers an agent that waits for them: it goes
|
||||
// through even though the agent is blocked (`hc send --force`). Never
|
||||
// from the queue.
|
||||
this.sendNow(agent, message, cx, { force: this.statusOf(agent) === "blocked" });
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1061,7 +1064,7 @@ export default class Composer extends View {
|
||||
}
|
||||
|
||||
/** The message goes to the terminal now. */
|
||||
async sendNow(agent, message, cx) {
|
||||
async sendNow(agent, message, cx, options = {}) {
|
||||
const key = agentKey(agent);
|
||||
if (this.draining.has(key)) {
|
||||
this.notice("Ta wiadomość jest już w locie.", "error", cx);
|
||||
@@ -1086,7 +1089,9 @@ export default class Composer extends View {
|
||||
this.persistQueue(key);
|
||||
|
||||
try {
|
||||
const result = await sendToTerminal({ terminal: agent.address, hc: this.sendHc }, message);
|
||||
const result = await sendToTerminal({ terminal: agent.address, hc: this.sendHc }, message, {
|
||||
force: options.force === true,
|
||||
});
|
||||
if (result.ok) {
|
||||
this.state = reduce(this.state, { type: "settle", agent: key, id, outcome: "sent" });
|
||||
this.persistQueue(key);
|
||||
|
||||
Reference in new issue
Block a user