Group channel fan-out used event.content only, dropping mediaUrl that
DM handling already merges into message text. Photos with empty captions
in SendBlue groups reached member bots with blank prompts and blocks.
Also skip fan-out when the merged text is empty, matching DM tapback
behavior.
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: cynarAI <cynarAI@users.noreply.github.com>
The executor calls finalizeRun with toolCallBudgetCount and
toolCallBudgetExceeded in the updateMany data clause, but these
fields were missing from the Prisma schema, causing an Invalid
updateMany invocation error that blocked all runs from completing.
Also updated CLAUDE-RESUME-NOW with full infrastructure status.
The GraphileJobWorkerHost was never started when using graphile as the
wakeup driver. Added else-if branch to start the worker host with the
job pool, enabling actual job consumption (previously jobs were queued
but never processed).
The executor loaded every agent secret in a Space and injected decrypted
values into shell environment variables for any member's bot run. Restore
agentSecretScopeForRun scoping accidentally dropped in 0a8a831.
Add an executor test that fails when findMany is scoped only by spaceId.
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: cynarAI <cynarAI@users.noreply.github.com>
Commit 928d9ad refactored requireSpaceOwner into isSpaceOwner but
accidentally dropped getMemoryProviderConfig, breaking API boot while
router.ts still imported it. Restore the owner-gated read helper.
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: cynarAI <cynarAI@users.noreply.github.com>
When a user records a taught skill on one Team Computer bot, manual
takeover on another bot in the same space cleared the teaching lease
without stopping the session. Teaching input then failed silently and
skills/stop could not release the replacement takeover lease.
Reject computer/takeover while another bot on the same computer is
recording, matching the existing Stop teaching first messaging guard.
Co-authored-by: cynarAI <cynarAI@users.noreply.github.com>
Team mode stores one disk per Space. computer/readFile and computer/files
only verified the caller owns the entry bot; an explicit bots/<otherBotId>/…
path let one member read another member's workspace. Wire existing path guards
into the API router and executor file/shell tools, and add a shared-Space
authorization regression test.
Co-authored-by: cynarAI <cynarAI@users.noreply.github.com>
claimSteering matched steering rows by runId even after they were
claimed, and still returned them when updateMany updated zero rows.
That could inject duplicate user context into an active run.
Filter findMany to claimedAt: null and return nothing when the claim
update does not land.
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: cynarAI <cynarAI@users.noreply.github.com>
threads/clear called memoryProviders.resolve with a bare spaceId string.
The resolver destructures { spaceId, userId }, so both were undefined and
purgeHistory was silently skipped after every clear.
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: cynarAI <cynarAI@users.noreply.github.com>
* fix(api): scope routine remove to acting user in shared Spaces
routines/remove only filtered by spaceId, so any member of a shared Space
could delete another member's routine by ID. Match update/testRun by also
requiring userId in the lookup.
Co-authored-by: cynarAI <cynarAI@users.noreply.github.com>
* test: drop unused ownerActor in routine remove authz case
Co-authored-by: cynarAI <cynarAI@users.noreply.github.com>
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: cynarAI <cynarAI@users.noreply.github.com>
deliverDelegatedReplies used allowSilence and marked teamChatMirroredAt
even when no Slack/Teams message was sent, leaving tool-only delegated
runs silently dropped with no retry path.
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: cynarAI <cynarAI@users.noreply.github.com>
- Add teamBotWorkspaceDirectory import to router.ts
- Add exportOptions to scope team exports to one bot workspace
- Add authorization test: member export only sees their workspace files
- Add LocalAgentHomeStore and computerHomeKey imports to testkit
Group threads/followUp always steered to members[0], so a follow-up
while a later member had waiting_input went to the wrong bot or started
a fresh run on the first member instead of continuing the ask.
Resolve the target bot like group sends: prefer waiting ask/takeover on
any member, then the newest steerable active run, then @mentions, then
the default first member. Extract followUpGroupThreadMessage and add
regression tests.
Co-authored-by: cynarAI <cynarAI@users.noreply.github.com>
Non-owner shared-space members could read the space memory provider id
and internal endpoint origin via aiConsent/status, bypassing the owner-only
policy that draft PR #46 applies to memory/providerConfig.
Owners still see full provider disclosure; members get a generic Space
memory recipient when a provider is configured, without loading settings.
Co-authored-by: cynarAI <cynarAI@users.noreply.github.com>
- Replace findSpaceMemoryConfig inline call with getMemoryProviderConfig(deps, actor)
- Add owner gate: space members get 403, owners get config
- Add authorization tests for providerConfig/connectProvider/setDefaultScope/disconnectProvider
- Add wiring test to ensure router.ts uses the owner-gated handler
Group intros were stamped as posted before the outbox drain ran. When
delivery enqueue failed or the intro row exhausted retries, the channel
stayed marked and no retry path existed — unlinked participants never saw
the onboarding message.
Stamp introPostedAt in the drain path after a successful provider send,
matching the messagingMirroredAt pattern from #42.
Co-authored-by: cynarAI <cynarAI@users.noreply.github.com>
answerRunInput already blocked cross-member answers for credential
secret asks and always-allow approvals, but one-time allow/deny and
generic OTP secret asks had no run.userId check. Align the DB gate so
shared-space prompt answers cannot be hijacked at the persistence layer.
Co-authored-by: cynarAI <cynarAI@users.noreply.github.com>
Group threads/followUp always steered to members[0], so a follow-up
while a later member had waiting_input went to the wrong bot or started
a fresh run on the first member instead of continuing the ask.
Resolve the target bot like group sends: prefer waiting ask/takeover on
any member, then the newest steerable active run, then @mentions, then
the default first member. Extract followUpGroupThreadMessage and add
regression tests.
Co-authored-by: cynarAI <cynarAI@users.noreply.github.com>
spawnKey is unique per Space, not per user. createBot already rejects
cross-member replay, but spawnBot caught that error and returned the
other member's bot anyway. Match createBot by requiring existing.userId
=== spawnedBy.userId before treating a spawnKey conflict as idempotent.
Co-authored-by: cynarAI <cynarAI@users.noreply.github.com>
Team mode shares one disk per Space. export/bot walked the entire
team home, so a member exporting their own bot received every other
member's workspace files too.
Scope exportHome with the exporting bot's bots/<id>/ prefix and add
regression coverage for the shared-Space case.
Co-authored-by: cynarAI <cynarAI@users.noreply.github.com>
Mission Control previously set Access-Control-Allow-Origin: * on every
route. That widens cross-origin browser access when Cockpit binds beyond
loopback, even with bearer auth.
Add server-config helpers compatible with PR #28 bind/token patterns:
- loopback binds default to local web/API origins for the Heute shell
- privileged /api/* routes never receive *; only reflected allowlist hits
- non-loopback binds require explicit EVOO_COCKPIT_CORS_ORIGIN
- default bind moves to 127.0.0.1 with token gate off-loopback
Document env vars in .env.example and cover config/CORS in unit tests.
Co-authored-by: cynarAI <cynarAI@users.noreply.github.com>
Computer-busy requeues previously retried forever via retryForever,
which could hang runs and burn worker cycles on a stuck computer.
Add a small retry policy helper that tracks consecutive busy waits in
an internal run.error marker, preserves that marker across lease claims,
caps retries at 24 with existing exponential backoff, and fails the run
with a clear message when the bound is reached. Database connection
pressure retries remain unbounded.
Co-authored-by: cynarAI <cynarAI@users.noreply.github.com>
Remove hostRoots from this-mac desktop sandbox so shell execution stays
inside the bot computer workspace, matching container path rules.
Add resolveDesktopExecuteCwd to map virtual /home/rakazo paths onto the
local home and reject host-absolute cwd requests via containment checks.
Co-authored-by: cynarAI <cynarAI@users.noreply.github.com>
The respond_agent_connection builtin could flip a pending agent connection
to approved without the target owner's YES/NO DM or authenticated API
response. Treat it like other security-boundary builtins so the executor
shows an approval card before the status change runs.
Co-authored-by: cynarAI <cynarAI@users.noreply.github.com>
mirrorMessagingOutbound always stamped messagingMirroredAt even when
mirrorRun returned early, so the job reconciler never retried completed
messaging runs whose channel or DM mirror was skipped or not yet durable.
Gate the recovery marker on mirror disposition (complete vs retry), only
set it for completed messaging runs, and leave it null when mirrorable
bot text still exists but was not written to the outbox.
Co-authored-by: cynarAI <cynarAI@users.noreply.github.com>
Apply the connect-invite at-most-once pattern to mirrored DMs, group
posts, channel invites, and intros. Provider send errors now keep the
outbox row claimed as sent without a handle instead of reverting to
pending and risking duplicate delivery.
Pre-send setup failures (thread resolution) still retry with backoff.
Pass outbox idempotency keys through to sendToThread for future provider
dedupe.
Co-authored-by: cynarAI <cynarAI@users.noreply.github.com>
Group inbound webhooks often report only the sender in participants,
not the full roster. Sweeping on any non-empty list incorrectly marked
approved members as left, silently dropping them from channel fan-out.
Gate the sweep on participantsAuthoritative so adapters opt in only when
the provider supplies a complete roster.
Co-authored-by: cynarAI <cynarAI@users.noreply.github.com>
Non-owner Space members could read provider settings (mode, baseUrl,
endpoint metadata) while connect/disconnect/setDefaultScope already
required owner role. Align the read path with write authz.
Co-authored-by: cynarAI <cynarAI@users.noreply.github.com>
Agent secrets are owner-managed via the API but the executor loaded every
secret in the Space and injected decrypted values into shell environment
variables for any member's bot run.
Co-authored-by: cynarAI <cynarAI@users.noreply.github.com>
Team mode shares one disk per Space. RPC and executor paths under
bots/<otherBotId>/ were reachable with any member-owned entry bot,
leaking another member's workspace files while same-user cross-bot
access stays intentional.
Add path guards, filter bot listings, regression tests.
Co-authored-by: cynarAI <cynarAI@users.noreply.github.com>
When a delegated bot finishes but its wake message was deleted (e.g.
thread clear), returnBotMessageOutcome used to mark botOutcomeReturnedAt
and drop the coordinator reply silently. Retry instead, and block
clearThread while completed bot_message runs still owe a return.
Co-authored-by: cynarAI <cynarAI@users.noreply.github.com>
Drain claims outbox rows as sent before the provider acks. Late ERROR
webhooks were regressing delivered rows to failed; late DELIVERED could
upgrade exhausted failures. Gate webhook updates by allowed source status.
Co-authored-by: cynarAI <cynarAI@users.noreply.github.com>