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:
@@ -35,6 +35,8 @@ import openBotKnowledgebases from "@/src/harness/tools/knowledgebases/open-bot-k
|
||||
import grabKnowledgebaseContext from "@/src/harness/tools/knowledgebases/grab-knowledgebase-context";
|
||||
import botMessagesToHarness from "./bot-messages-to-harness";
|
||||
import composeComputersNote from "./compose-computers-note";
|
||||
import composeEnvsNote from "./compose-envs-note";
|
||||
import grabReachableEnvs from "@/src/functions/backend/db/envs/grab-reachable-envs";
|
||||
import grabSessionCarryOver from "./grab-session-carry-over";
|
||||
import continueInNewSessionTool from "@/src/harness/tools/bot/continue-in-new-session-tool";
|
||||
import searchPastSessionsTool from "@/src/harness/tools/bot/sessions/search-past-sessions-tool";
|
||||
@@ -145,6 +147,17 @@ export default async function runBotReply({
|
||||
const prompt = await grabBotPrompt({ bot_id: bot.id, user_id, workspace_id });
|
||||
const computers = await grabBotComputers({ bot_id: bot.id, workspace_id });
|
||||
|
||||
/**
|
||||
* The envs the reply has (keys only), so it doesn't ask for or test
|
||||
* ones that are set.
|
||||
*/
|
||||
const envs = await grabReachableEnvs({
|
||||
bot_id: bot.id!,
|
||||
user_id,
|
||||
workspace_id,
|
||||
computer_id: computers[0]?.id || null,
|
||||
});
|
||||
|
||||
/**
|
||||
* A summary that can't be written now (no model free) is left out
|
||||
* rather than holding up the reply.
|
||||
@@ -312,6 +325,7 @@ export default async function runBotReply({
|
||||
TaskReminderNote,
|
||||
ActionCheckNote,
|
||||
SecretsNote,
|
||||
composeEnvsNote({ ...envs, has_computer: computers.length > 0 }),
|
||||
GraphicsNote,
|
||||
workspace_id ? WorkspaceLearningNote : "",
|
||||
composeComputersNote({
|
||||
|
||||
Reference in New Issue
Block a user