Tell replies their envs and call queued work runs
Chat replies now list the envs that reach them (keys and descriptions, never values), so a bot no longer asks for keys that are set or "checks" them with show_secret or printenv. request_secret refuses a key that's already set unless the user asked to replace it, and search_computers says envs aren't loaded in its shell. start_task and delegate_task results say "Run #N" and that list_tasks doesn't show it, since bots sent users to the to-do list for queue jobs. start_task refuses a second open run in the session on the same computer unless it's separate work, and says how many runs are ahead on that computer. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import { describe, expect, test } from "bun:test";
|
||||
import composeEnvsNote from "./compose-envs-note";
|
||||
|
||||
describe("composeEnvsNote", () => {
|
||||
test("lists the computer's envs and the tools-only ones apart", () => {
|
||||
const note = composeEnvsNote({
|
||||
on_computer: [{ key: "DB_PASSWORD", description: "Production database" }],
|
||||
tools_only: [{ key: "API_TOKEN", description: "" }],
|
||||
has_computer: true,
|
||||
});
|
||||
|
||||
expect(note).toContain("- DB_PASSWORD: Production database");
|
||||
expect(note).toContain("- API_TOKEN");
|
||||
expect(note).not.toContain("- API_TOKEN:");
|
||||
expect(note.indexOf("DB_PASSWORD")).toBeLessThan(note.indexOf("Only in tools"));
|
||||
expect(note).toContain("Don't ask the user for them");
|
||||
});
|
||||
|
||||
test("never mentions values", () => {
|
||||
const note = composeEnvsNote({ on_computer: [{ key: "K", description: "d" }], tools_only: [], has_computer: true });
|
||||
|
||||
expect(note).not.toContain("Only in tools");
|
||||
expect(note).toContain("you never see values");
|
||||
});
|
||||
|
||||
test("says so when nothing is set", () => {
|
||||
expect(composeEnvsNote({ on_computer: [], tools_only: [], has_computer: false })).toContain("No envs are set");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user