@meetopenbot/openbot 1.2.4 → 1.2.7

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.
@@ -10,7 +10,7 @@ export const AUTO_MODEL_OPTION = {
10
10
  * Auto currently always uses this model. Restore a cheap pool (preference
11
11
  * order, failover, intent routing) without changing the `openbot/auto` alias.
12
12
  */
13
- export const AUTO_MODEL_POOL = ['deepseek/deepseek-v4-flash'];
13
+ export const AUTO_MODEL_POOL = ['deepseek/deepseek-v4.1-flash'];
14
14
  function providerByokKeys(provider) {
15
15
  return BYOK_ENV_KEYS[provider];
16
16
  }
package/dist/runtime.js CHANGED
@@ -8,6 +8,7 @@ import { AUTO_MODEL_ID, isAutoModel, isRetryableModelError, listAutoModelCandida
8
8
  import { reasoningForModel, resolveModel } from './model.js';
9
9
  import { errorFromStreamPart } from './stream-error.js';
10
10
  import { createAgentOutputBuffer, isOutputBoundaryPart } from './output-buffer.js';
11
+ import { threadNamingHint } from './thread-naming.js';
11
12
  async function buildSystemPrompt(state, storage, instructions, host) {
12
13
  const context = await buildContext(state, storage, host);
13
14
  const sections = [
@@ -16,9 +17,7 @@ async function buildSystemPrompt(state, storage, instructions, host) {
16
17
  context,
17
18
  ];
18
19
  const threadState = state.threadDetails?.state;
19
- if (!threadState?.isSmartNamed) {
20
- sections.push('', '## SYSTEM HINT', 'This thread is unnamed. Please use the `set_thread_title` tool to set a concise, descriptive title (e.g., "Project Brainstorming" instead of "project-brainstorm"). Only do this once.');
21
- }
20
+ sections.push(...threadNamingHint(threadState));
22
21
  return sections.join('\n');
23
22
  }
24
23
  function toAiTools(tools, args, flushPendingOutput) {
@@ -32,6 +32,7 @@ export const OPENBOT_SYSTEM_PROMPT = [
32
32
  "# JOB TITLE",
33
33
  "- Unnamed jobs get a system hint to call `set_thread_title` once with a concise, human-readable title.",
34
34
  "- Call `set_thread_title` again only if the topic clearly changes.",
35
+ "- Never re-title a job the user renamed.",
35
36
  "",
36
37
  "# JOB STATUS",
37
38
  "- Every thread is a job. Status is `working` (in progress), `needs_input`, `ready_for_review`, `completed`, or `archived`.",
@@ -55,6 +56,10 @@ export const OPENBOT_SYSTEM_PROMPT = [
55
56
  "- When you ask a coding agent to run a dev server, preview, or any local process the human should open, tell them to expose it with `cloudflared tunnel --url http://127.0.0.1:<port>` and to add `cloudflared` as a **project devDependency** (not a global install — this image is ephemeral and only workspace files persist).",
56
57
  "- Share the `https://*.trycloudflare.com` URL they print. Quick tunnels change on restart — pass the new one through. If they report a localhost URL, ask them to tunnel it.",
57
58
  "",
59
+ "# SPACE VARIABLES",
60
+ "- Secrets live in OpenBot variables, not in chat. Workspace-wide keys: Settings → Variables. Per-space keys: Space menu → Variables (override workspace keys with the same name).",
61
+ "- Coding agents inherit merged variables in their shell environment — including `pnpm dev` subprocesses. Do not ask the human to paste secrets. Only tell a coding agent to write a project `.env` when the scaffold requires it or the app errors about a missing `.env`; otherwise a restarted dev server should pick up keys from the shell (use exact names such as `VITE_*` for Vite).",
62
+ "",
58
63
  "# COMMUNICATION & WRITING STYLE",
59
64
  "- Be concise, professional, proactive, and polite.",
60
65
  "- Confirm receipt quickly. For longer work, say where you are taking it and who you will ask.",
@@ -0,0 +1,25 @@
1
+ function asNamingState(state) {
2
+ return state && typeof state === 'object' ? state : {};
3
+ }
4
+ /** True when the user renamed the thread; the agent must not re-title it. */
5
+ export function isManuallyNamedThread(state) {
6
+ return asNamingState(state).isManuallyNamed === true;
7
+ }
8
+ /** The stored thread name from `state.json`, or `''`. */
9
+ export function threadNameFromState(state) {
10
+ const { name } = asNamingState(state);
11
+ return typeof name === 'string' ? name.trim() : '';
12
+ }
13
+ /** System-prompt lines asking the agent to name the thread, or `[]` once it has a name. */
14
+ export function threadNamingHint(state) {
15
+ if (asNamingState(state).isSmartNamed || isManuallyNamedThread(state))
16
+ return [];
17
+ return [
18
+ '',
19
+ '## SYSTEM HINT',
20
+ 'This thread is unnamed. Please use the `set_thread_title` tool to set a concise, descriptive title (e.g., "Project Brainstorming" instead of "project-brainstorm"). Only do this once.',
21
+ ];
22
+ }
23
+ export function manualNameKeptOutput(name) {
24
+ return `The user named this job "${name}"; kept their name and did not change the title.`;
25
+ }
@@ -1,10 +1,11 @@
1
1
  import z from "zod";
2
+ import { isManuallyNamedThread, manualNameKeptOutput, threadNameFromState, } from "../thread-naming.js";
2
3
  function formatTitleOutput(title) {
3
4
  return `Job title set to ${title}.`;
4
5
  }
5
6
  export const toolDefinitions = {
6
7
  set_thread_title: {
7
- description: "Set this job's title. Use a concise, human-readable name (e.g. \"Project Brainstorming\", not \"project-brainstorm\"). Call once when the thread is unnamed; call again only if the topic clearly changes.",
8
+ description: "Set this job's title. Use a concise, human-readable name (e.g. \"Project Brainstorming\", not \"project-brainstorm\"). Call once when the thread is unnamed; call again only if the topic clearly changes. Never re-title a job the user renamed.",
8
9
  inputSchema: z.object({
9
10
  title: z
10
11
  .string()
@@ -28,6 +29,20 @@ export const tools = {
28
29
  if (!title) {
29
30
  throw new Error("title is required");
30
31
  }
32
+ const current = await ctx.storage.getThreadDetails({
33
+ channelId,
34
+ threadId,
35
+ });
36
+ if (isManuallyNamedThread(current.state)) {
37
+ ctx.state.threadDetails = current;
38
+ const keptName = threadNameFromState(current.state);
39
+ return {
40
+ success: true,
41
+ skipped: true,
42
+ title: keptName,
43
+ output: manualNameKeptOutput(keptName),
44
+ };
45
+ }
31
46
  await ctx.storage.patchThreadState({
32
47
  channelId,
33
48
  threadId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meetopenbot/openbot",
3
- "version": "1.2.4",
3
+ "version": "1.2.7",
4
4
  "description": "OpenBot coordinator runtime: ask specialists, route work into Spaces, and track todos.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -19,13 +19,13 @@
19
19
  "dist"
20
20
  ],
21
21
  "dependencies": {
22
- "@ai-sdk/anthropic": "^4.0.42",
23
- "@ai-sdk/deepseek": "^3.0.32",
22
+ "@ai-sdk/anthropic": "^4.0.60",
23
+ "@ai-sdk/deepseek": "^3.0.50",
24
24
  "@ai-sdk/google": "^4.0.58",
25
- "@ai-sdk/openai": "^4.0.46",
26
- "ai": "^7.0.77",
25
+ "@ai-sdk/openai": "^4.0.72",
26
+ "ai": "^7.0.111",
27
27
  "zod": "^4.3.5",
28
- "@meetopenbot/plugin-sdk": "^1.1.3"
28
+ "@meetopenbot/plugin-sdk": "^1.2.1"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/node": "^20.10.1",