Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ Newest first. `Unreleased` is what is on `main` and not yet tagged.

## Unreleased

### Example LangGraph and Mastra Bots no longer bind an ephemeral port on empty `PORT=`

An empty `PORT=` in compose or `.env` used to become `NaN` for those two example processes, so they listened on a random port while docs still named 4300/4400. They now use the same `listenPort` helper as `agent-bot`: empty is the documented default, and a prefix typo refuses to start.

## 0.0.8

### A desktop shell that installs OpenBot and then becomes it
Expand Down
8 changes: 7 additions & 1 deletion examples/langgraph-bot/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
import { Annotation, END, START, StateGraph } from "@langchain/langgraph";
import { ChatOpenAI } from "@langchain/openai";
import { serve } from "bun";
import { listenPort } from "../../shared/listen-port";

/**
* A Bot written in LangGraph.
Expand All @@ -26,7 +27,12 @@ import { serve } from "bun";
* `computer_navigate` and still drives a governed browser.
*/

const PORT = Number.parseInt(process.env.PORT ?? "4300", 10);
const resolvedPort = listenPort(process.env.PORT, 4300);
if (!resolvedPort.ok) {
console.error(resolvedPort.reason);
process.exit(1);
}
const PORT = resolvedPort.port;
const MODEL = process.env.BOT_MODEL ?? "gpt-5.5";
/**
* `gpt-5.6-*` rejects function tools on `/v1/chat/completions` and needs the Responses API, which
Expand Down
8 changes: 7 additions & 1 deletion examples/mastra-bot/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { EventEncoder } from "@ag-ui/encoder";
import { openai } from "@ai-sdk/openai";
import { Agent } from "@mastra/core/agent";
import { serve } from "bun";
import { listenPort } from "../../shared/listen-port";

/**
* A Bot written in Mastra.
Expand All @@ -16,7 +17,12 @@ import { serve } from "bun";
* as `agent-bot` and the LangGraph example.
*/

const PORT = Number.parseInt(process.env.PORT ?? "4400", 10);
const resolvedPort = listenPort(process.env.PORT, 4400);
if (!resolvedPort.ok) {
console.error(resolvedPort.reason);
process.exit(1);
}
const PORT = resolvedPort.port;
const MODEL = process.env.BOT_MODEL ?? "gpt-5.5";
/**
* `gpt-5.6-*` rejects function tools on `/v1/chat/completions` and needs the Responses API, which
Expand Down