Skip to content

The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.

feat(backend): the programs_reply experiment, so harness settings programs-reply on holds (#1628)

85cf6a6e79ddf85da8d7169e1078
diff --git a/backend/prisma/schema.prisma b/backend/prisma/schema.prisma
index 164809458..18b12bfe2 100644
--- a/backend/prisma/schema.prisma
+++ b/backend/prisma/schema.prisma
@@ -1674,6 +1674,9 @@ model ExperimentalSettings {
agentMessagesHideSummary Boolean @default(false)
/// An agent may give more work to a harness it started (`harness tell`, cli/src/messages/tell.ts). Off by default.
agentsTellAgents Boolean @default(false)
+ /// A program acting for the person (a lamp's lamp-tasks, not an agent) may give more work to an idle harness of
+ /// theirs in a pane (`harness reply`, cli/src/messages/replyLocal.ts, #1628). Off by default.
+ programsReply Boolean @default(false)
revision Int @default(0)
@@index([userId])
diff --git a/backend/src/lib/experimentalSettings.ts b/backend/src/lib/experimentalSettings.ts
index 17c8de502..44d41c3b7 100644
--- a/backend/src/lib/experimentalSettings.ts
+++ b/backend/src/lib/experimentalSettings.ts
@@ -7,8 +7,10 @@ import { prisma } from './prisma.js'
* (shared-tab activity design, ruling T4). The three before it are what agents may do with Harness: they left each computer's
* Settings ▸ Agents for here, one choice for every computer of the account (owner, 2026-10-12). `agents_tell_agents` is
* another: an agent may give more work to a harness it started (`harness tell`), behind a switch of its own because a
- * harness another started gets no exception from Agent Messages (owner, 2026-10-11). */
-export const experimentalFeatures = ['focus_bar_creature', 'share_button', 'devices_tab', 'agents_start_agents', 'agent_pull_request_line', 'agent_messages', 'agent_messages_hide_summary', 'agents_tell_agents'] as const
+ * harness another started gets no exception from Agent Messages (owner, 2026-10-11). `programs_reply` is the last: a
+ * program acting for the person, such as a lamp, may give more work to an idle harness of theirs in a pane (`harness
+ * reply`, #1628), a switch apart from `agents_tell_agents`, which is about agents. */
+export const experimentalFeatures = ['focus_bar_creature', 'share_button', 'devices_tab', 'agents_start_agents', 'agent_pull_request_line', 'agent_messages', 'agent_messages_hide_summary', 'agents_tell_agents', 'programs_reply'] as const
export type ExperimentalFeature = typeof experimentalFeatures[number]
export const experimentalSettingsId = (userId: string): string =>
createHash('sha256').update(JSON.stringify(['experimental-settings', userId])).digest('hex').slice(0, 24)
@@ -17,7 +19,7 @@ export const experimentalSettingsId = (userId: string): string =>
const FIELDS = {
focus_bar_creature: 'focusBarCreature', share_button: 'shareButton', devices_tab: 'devicesTab',
agents_start_agents: 'agentsStartAgents', agent_pull_request_line: 'agentPullRequestLine', agent_messages: 'agentMessages',
- agent_messages_hide_summary: 'agentMessagesHideSummary', agents_tell_agents: 'agentsTellAgents',
+ agent_messages_hide_summary: 'agentMessagesHideSummary', agents_tell_agents: 'agentsTellAgents', programs_reply: 'programsReply',
} as const satisfies Record<ExperimentalFeature, string>
type Row = { [K in (typeof FIELDS)[ExperimentalFeature]]?: boolean } & { revision: number }
diff --git a/backend/src/routes/experimentalSettings.test.ts b/backend/src/routes/experimentalSettings.test.ts
index 4ca4d2573..dca6c9282 100644
--- a/backend/src/routes/experimentalSettings.test.ts
+++ b/backend/src/routes/experimentalSettings.test.ts
@@ -17,10 +17,10 @@ import { registerAuthMiddleware } from '../middlewares/authMiddleware.js'
import { errorHandler } from '../middlewares/errorHandler.js'
type Row = { id: string; userId: string; focusBarCreature: boolean; shareButton: boolean; devicesTab?: boolean
- agentsStartAgents?: boolean; agentPullRequestLine?: boolean; agentMessages?: boolean; agentMessagesHideSummary?: boolean; agentsTellAgents?: boolean; revision: number }
-const COLUMNS = ['focusBarCreature', 'shareButton', 'devicesTab', 'agentsStartAgents', 'agentPullRequestLine', 'agentMessages', 'agentMessagesHideSummary', 'agentsTellAgents'] as const
+ agentsStartAgents?: boolean; agentPullRequestLine?: boolean; agentMessages?: boolean; agentMessagesHideSummary?: boolean; agentsTellAgents?: boolean; programsReply?: boolean; revision: number }
+const COLUMNS = ['focusBarCreature', 'shareButton', 'devicesTab', 'agentsStartAgents', 'agentPullRequestLine', 'agentMessages', 'agentMessagesHideSummary', 'agentsTellAgents', 'programsReply'] as const
/** Every experiment off, as a new account reads them. */
-const OFF = { focus_bar_creature: false, share_button: false, devices_tab: false, agents_start_agents: false, agent_pull_request_line: false, agent_messages: false, agent_messages_hide_summary: false, agents_tell_agents: false }
+const OFF = { focus_bar_creature: false, share_button: false, devices_tab: false, agents_start_agents: false, agent_pull_request_line: false, agent_messages: false, agent_messages_hide_summary: false, agents_tell_agents: false, programs_reply: false }
describe('account experiments and retained collections', () => {
let app: FastifyInstance
let rows: Map<string, Row>
@@ -60,7 +60,7 @@ describe('account experiments and retained collections', () => {
expect(mocks.prisma.experimentalSettings.findUnique).not.toHaveBeenCalled()
expect((await read()).json().data).toEqual({ accountId: 'owner', revision: 0, features: OFF, available: {
focus_bar_creature: true, share_button: true, devices_tab: true, agents_start_agents: true, agent_pull_request_line: true, agent_messages: true, agent_messages_hide_summary: true,
- agents_tell_agents: true } })
+ agents_tell_agents: true, programs_reply: true } })
expect(rows.size).toBe(0)
expect((await zoo()).statusCode).toBe(404)
expect(mocks.prisma.zoo.findUnique).not.toHaveBeenCalled()
@@ -85,6 +85,17 @@ describe('account experiments and retained collections', () => {
expect(rows.get(id)!.agentMessages).not.toBe(true)
expect(mocks.deskChanged).toHaveBeenCalledWith('owner', { revision: 0 })
})
+ it('keeps a program giving an idle harness more work off until the account turns it on, apart from agents telling agents', async () => {
+ const id = experimentalSettingsId('owner')
+ // A row from before the column: off.
+ rows.set(id, { id, userId: 'owner', focusBarCreature: false, shareButton: false, devicesTab: false, agentsTellAgents: true, revision: 4 })
+ expect((await read()).json().data.features.programs_reply).toBe(false)
+ expect((await write('programs_reply', true)).json().data.features).toEqual({ ...OFF, agents_tell_agents: true, programs_reply: true })
+ expect(rows.get(id)).toMatchObject({ programsReply: true, agentsTellAgents: true, revision: 5 })
+ expect((await write('programs_reply', false)).json().data.features.programs_reply).toBe(false)
+ expect(rows.get(id)!.agentsTellAgents).toBe(true)
+ expect(mocks.deskChanged).toHaveBeenCalledWith('owner', { revision: 0 })
+ })
it('shares choices between clients without losing concurrent changes to different switches', async () => {
expect((await Promise.all([write('focus_bar_creature', true), write('share_button', true)])).map(r => r.statusCode)).toEqual([200, 200])
expect((await read()).json().data).toMatchObject({ revision: 2, features: { focus_bar_creature: true, share_button: true } })
diff --git a/backend/src/routes/experimentalSettings.ts b/backend/src/routes/experimentalSettings.ts
index b08d50176..c179063bf 100644
--- a/backend/src/routes/experimentalSettings.ts
+++ b/backend/src/routes/experimentalSettings.ts
@@ -12,7 +12,7 @@ export async function experimentalSettingsRoutes(app: FastifyInstance, opts: { d
const available = (user: { sub: string; email?: string | null } | undefined) => ({
focus_bar_creature: daemonsFor(opts.daemons ?? DAEMONS_DARK, user), share_button: true, devices_tab: true,
agents_start_agents: true, agent_pull_request_line: true, agent_messages: true, agent_messages_hide_summary: true,
- agents_tell_agents: true,
+ agents_tell_agents: true, programs_reply: true,
})
app.get('/api/experimental-settings', async (req, reply) => {
sendSuccess(reply, { accountId: req.user!.sub, ...await readExperimentalSettings(req.user!.sub), available: available(req.user) })