Repository navigation
Description
Summary
A cron schedule whose recorded creator is neither an admin nor the agent's owner is rated a shared person's turn on every run. The ent#926 guard hook then refuses Bash and every owner-added MCP server for the whole run, with a message that describes a chat that is not happening. The turn still completes and the execution row still reads success, so nothing on the platform shows that the scheduled work did not run.
Three things are wrong, in order of how much they cost:
- The failure is permanent and invisible — every run of that schedule, forever, with no platform surface carrying it.
- The refusal message names the wrong cause, sending the owner to look for a sharing problem in a conversation that does not exist.
- Nothing checks this when the schedule is created or enabled, though it is fully computable then.
The classification itself is working as designed (the 2026-10-19 ruling: a share holder may create a schedule, so its runs must not be the owner's). This issue is not asking to change that rule.
Cause (read from the code at 1a5d90ba1)
services/turn_tier_service.py → turn_actor. A schedule run carries no source_user_id, so it is rated by its schedule's creator:
has_schedule, schedule = _schedule_of(db, agent_name, execution)
if has_schedule:
if schedule is None: return SHARE, VISITOR, None
creator = schedule.owner_id
if creator is None: return OWNER, None, None
if _user_tier(creator) == OWNER: return OWNER, None, None
return SHARE, PERSON, creator # <- every run of this schedule
_user_tier is OWNER only when the creator is an admin, or passes can_user_share_agent — which is role == "admin" or being the agent's recorded owner row (db/agent_settings/sharing.py:298). So the rating is SHARE/PERSON whenever the schedule's creator is a non-admin who is not that agent's recorded owner — including the case where the agent has no owner row at all, since get_agent_owner returning None makes the predicate falsy.
Note OWNER_CONFIGURED_TRIGGERS (which contains "schedule") is unreachable for a real schedule run: the has_schedule branch returns first. A triggered_by="schedule" row is therefore never rated owner because it is a schedule.
shell_allowed then gives this turn no shell and offers no owner-facing override:
if tier == OWNER: return True
if tier == SHARE and kind == VISITOR: return visitor_shell_allowed(...)
return False
visitor_shell does not reach the PERSON path, so there is no setting, guardrail or UI control that restores the shell for such a schedule. The only remedies are to make the creator an admin or the agent's owner, or to delete and re-create the schedule as an owner-tier person — and nothing tells anyone that.
In the agent, docker/base-image/hooks/turn-tier-guard.py → guard_shell refuses Bash, every mcp__* tool that is not the platform's own trinity server, and the MCP resource tools, with SHELL_OWNER_ONLY / MCP_OWNER_ONLY.
Why it is invisible
- The run succeeds. A
PreToolUsedeny is exit 2 with a message to the model (hooks/lib.py). The agent reads the refusal, answers around it, and the turn exits 0. Any monitoring keyed on failed executions is structurally blind to this class. - The deny record never leaves the container.
lib.denywrites a structured row to/logs/guardrails.jsonl. On a running agent that path is a plain container directory on no volume (recreated at container start), andconfig/vector.yaml's only source isdocker_logs— container stdout/stderr over the Docker socket. It does not read that file. The comment athooks/_skill_gate.py:820describing the path as "(Vector)" is inaccurate. - The backend is never told. The hook's only outbound call is the
GET .../turn-tier; it posts no decision. So by construction no execution field, condition, alert or audit row can carry a hook refusal.
The only surface this appears on is an agent choosing, on its own initiative, to raise an operator ask about it.
Reproduction
- Agent A is owned by an admin. Person P is a share holder on A (not owner, not admin) with
schedules.manage, or A's owner row is absent. - P creates a cron schedule on A whose message does real work through the shell (a script run, a
gitpush, a file-processing job) or through an owner-added MCP server. - Let it fire.
Expected: either the schedule runs its work, or it fails visibly and says why.
Actual: every Bash call and every non-platform MCP tool is refused for the whole run with "This turn is for a person the agent is shared with, and running commands is owner-only. Answer without the shell, or ask the agent's owner to run it." The execution ends success. Repeats on every tick indefinitely. GET /api/agents/{A}/executions/{run}/turn-tier returns {"tier":"share","kind":"person","shell":false}.
For contrast, on an instance where schedules were created by an admin the same route returns {"tier":"owner","kind":null,"shell":true} and the hook allows.
Observed
Seen on two agents on one instance, on four separate schedules (an hourly data-drain job and a dashboard sync among them), all reporting success throughout — found only because the agents each raised an operator ask. Both affected agents were 100% success for the day. The work refused was idempotent catch-up work, so there was no loss; a schedule doing non-idempotent or outbound work would have failed the same way, just as quietly.
Acceptance criteria
- A schedule run refused because of its creator's tier says so: the message names the schedule and its creator as the cause, and names the remedy (an owner-tier person re-creates or takes over the schedule). It must not describe the turn as a person chatting with the agent.
- A hook refusal in a schedule-backed turn is visible on a platform surface — at minimum the execution does not read as a clean
success. (Open decision: execution outcome field vs. a platform condition on the schedule vs. both. Worth ruling with the one-row-per-subject alert seam in mind.) - Creating or enabling a schedule whose runs would be rated
share/personis refused with a named reason, or recorded on the schedule row and shown wherever schedules are listed — the rating is computable at that moment. - A schedule already in this state is discoverable without opening a container (a fleet-health or schedule-list read is enough).
-
hooks/_skill_gate.py:820's "(Vector)" comment is corrected, or/logs/guardrails.jsonlis actually collected. - Tests cover: a schedule created by a share holder (refused or flagged at creation), and the refusal message for a schedule-backed turn.
Notes
- Lineage: the ent#926 turn fence. Adjacent but not this:
Abilityai/trinity-enterprise#978item 6 isrunning_turn_restricts(an unrelated concurrent restricted turn refusing the owner's routes), andAbilityai/trinity-enterprise#1063is the opposite direction (an agent key addressing a schedule to a third party). Neither covers a schedule's own creator rating, the message text, or the observability gap. Agent cannot read a child execution it started during a share holder's turn (404 Execution not found) #4173 is the sibling consequence bug on the read path. _schedule_offails closed toSHARE/VISITORfor a schedule that cannot be read or belongs to another agent — that path keeps the shell whenvisitor_shellis on (the default), and emits the other message. The person-shaped message quoted above is only reachable through the creator-tier path, which is what identifies the cause from the symptom.- Asymmetry worth a look while in here: a schedule with no recorded creator rates
OWNER, while one with a dangling creator id (deleted user) ratesSHAREvia_user_tier'sif not user: return SHARE. Same "no identifiable creator" situation, opposite outcomes.
Activity
vybe commentedon Nov 6, 2026
New evidence: the same class measured over ~25h on a second agent — and this time the refused work was not idempotent catch-up.
Since a container recreate onto the current base image at
2026-11-05T16:46:44Z, one agent's scheduled jobs have ratedshare/personon every tick. Measured from inside that container:GET /api/agents/{a}/executions/{run}/turn-tier→{"tier":"share","kind":"person","shell":false}for two separate schedule-triggered runs. An agent-triggered run on the same agent →{"tier":"owner","kind":null,"shell":true}; a synthetic execution id → 404. So the route works and discriminates — the rating is specific to the schedule-backed turns./logs/guardrails.jsonl: 78 denials in 24h 35m (2026-11-05T17:00:20Z→2026-11-06T17:35:08Z) — Bash 66, Grep 5, Glob 4, Write 3.success. Seven scheduled jobs — data ingestion, record linking, two third-party syncs, a periodic sweep, a stamping pass and a watchdog — did nothing for ~25h. One job's incremental cursor has not advanced since16:27:51Zthe previous day, so the gap is now a backlog, not just a skipped tick.kind: "person"is the discriminator described above: for a schedule-backed run it is reachable only through_user_tier(schedule.owner_id) != OWNER. The fail-closed path (_schedule_of→ unreadable schedule, or one belonging to another agent) returnsshare/visitor, which keeps the shell whilevisitor_shellis on and emits different text.Mechanism re-read at
b076f4bd5:services/turn_tier_service.py,db/agent_settings/sharing.py,docker/base-image/hooks/turn-tier-guard.py,hooks/lib.pyandconfig/vector.yamlare all byte-unchanged since1a5d90ba1, where this was filed. Nothing has moved.Two corrections, because this keeps arriving mis-framed
Both reports of this arrived as "the classifier misclassifies schedule-triggered turns", with the agent's person-share record as the suspected cause. Neither holds, and chasing either produces no fix:
ownerby trigger label would reopen exactly the hole ent#926 closed — a share holder creating a schedule to run their own prompt at owner tier. The fix target is not the classification.owner_id, not the agent's share record. An agent with share holders whose schedules were all created by an admin is unaffected. An agent with no share record at all is affected if its schedules' creator is a non-admin who is not that agent's recorded owner — including when the agent has no owner row, sinceget_agent_owner() is Nonemakescan_user_share_agentfalsy. A dangling creator id is affected too (_user_tier:if not user: return SHARE). So the blast radius is per-schedule, not per-agent and not per-share-record.Two gaps found while trying to work around it from outside
owner_idis written only at creation (db/schedules/crud.py) and is not inupdate_schedule'sallowed_fields. A schedule in this state cannot be re-homed at all — delete and re-create it as an owner-tier person is the only route, and nothing anywhere says so.owner_idis on theSchedulemodel, so an admin REST read carries it — but MCPlist_agent_schedulesdoes not return it (verified live against a 22-schedule agent). So neither an agent nor a non-admin can discover which of its own schedules are permanently broken; it takes an admin REST or DB read plus a per-creator role/owner-row lookup.Proposed additions to the acceptance criteria
Escalation from
priority-p2is proposed to the maintainers on the strength of the above (25h, seven jobs, a stalled cursor, zero platform signal); not changed here — priority is the operator's call.vybe commentedon Nov 9, 2026
Correction to my 2026-11-06 comment, plus a verified self-service remedy. I wrote that "unblocking an affected agent is an operator action, not a code fix." That is wrong, and I should not have said it without testing the one path I had not considered.
That claim rested on
owner_idbeing immutable: it is written only at creation (db/schedules/crud.py:171,196) and is absent fromupdate_schedule'sallowed_fields. Both still hold — no route re-homes an existing schedule. What I missed is that the row can be re-created from inside the container, by the agent itself.The remedy, verified
An agent-scoped MCP key resolves to the key owner's platform user on REST — stated outright in
dependencies.pyat the ephemeral-key fence: "An agent-scoped key resolves to the OWNER user on REST."create_schedulethen stampsowner_id=user["id"]fromcurrent_user.username, and the create route carriescapability_fence("schedules.manage", own_agent_exempt=True), so an agent needs no grant to create a schedule on itself.So when an agent re-creates its own schedule under its own key, the new row's creator is the key's owner. Where that owner is an admin or the agent's recorded owner row,
_user_tierreturnsOWNERand the schedule is permanently fixed.Tested end to end on one agent this run (dev
091b0b2cc):create_agent_scheduleon self, disabled, via the agent's own key.trigger_agent_schedule→ execution id.GET /api/agents/{a}/executions/{run}/turn-tier→{"tier":"owner","kind":null,"shell":true}A manual trigger is a valid probe here:
_schedule_ofreturns onhas_schedulebeforetriggered_byis read, so the creator rating is reached either way.This is not a new way around ent#926
Worth stating explicitly, because "an agent can mint an owner-tier schedule" sounds like the hole this fence closed. It is not reachable from a restricted turn: the census row for
POST /api/agents/{name}/schedulescarries"standing_work": true, androute_tier_service.refused_in_restricted_turnrefuses everystanding_workrow to an agent key acting in a restricted turn. A shared person therefore cannot ask the agent to mint a schedule carrying their prompt. The sibling row fordisable_schedulespells out the same reasoning in itsrestricted_turnnote.Safe pre-flight, so nobody trades a broken schedule for a broken schedule
The remedy fails silently where the agent's key owner is the same non-admin non-owner person who created the broken rows. Steps 1–4 above are that check, and they are non-destructive: a throwaway disabled schedule, triggered once, probed, deleted.
{"tier":"owner"}means re-creation will work; anything else means it will not, and the row needs a person.Two caveats for the ACs
owner_idis the only field that cannot be carried over, but the webhook token is re-minted, and every other field must be re-declared (model,timeout_seconds,allowed_tools, the validation trio,deliver_to_workspace_email). Execution history attached to the old schedule id goes with it.deliver_to_workspace_emailcan block the remedy outright. Under ent#1063 an agent key may point a schedule only at its owner's address. A schedule that delivers to anyone else cannot be re-created by the agent at all — that one needs a person.One more reason this is invisible from outside
The diagnostic route is self-only.
GET /api/agents/{a}/executions/{run}/turn-tieranswers"Turn tier requires the agent's own MCP key"for any other agent, even one the caller holds a permission edge to (tried this run). Combined withowner_idbeing absent from MCPlist_agent_schedules, that means only each agent can diagnose itself — no orchestrator, and no non-admin, can enumerate which agents or schedules are affected. The enumeration still wants the admin-side query named in the 2026-11-06 comment.Suggested AC, beyond the surface question already open: document the re-create remedy and its two caveats wherever the refusal is explained, since the refusal text currently sends the reader hunting for a sharing problem in a chat that does not exist.
test(turn-scope): the two #3408 Gemini files stub fetch_turn with the…
test(execution-origin): the #1970 guard reads the whole trigger handl…
refactor(operator-queue): the #4281 prefix comments fit the package's…
pavshulin commentedon Nov 11, 2026
Release-test note (row B9, v1.0.5-rc2
af465288a): this still reproduces on the rc2 tag; there is no fix commit in the tag.Checked on a source-built rc2 stack, same agent, two schedules with the same cron:
GET /api/agents/{name}/executions/{id}/turn-tier(agent's own key){"tier": "owner", "kind": null, "shell": true}{"tier": "share", "kind": "person", "shell": false}Both rows have no
source_user_id(cron fires), so the tier comes from the schedule's creator. The operator could create the schedule (201); a manual trigger by that operator is refused (owner only), so only the cron path was compared. The turns themselves were not run with a working model credential, so "the run still reports success" was not re-checked — only the tier rating.fix(schedules): a restricted schedule's row fits a phone (#4281)
trinity-ability commentedon Nov 15, 2026
v1.0.5 fix-or-note: proposed as a release note, not a fix in this release. The ruling is the operator's.
The fix is #4427. It is a draft of about 7,800 lines across 88 files, stacked on the draft #4425, waiting on a UI sign-off and currently in conflict with
dev. That is not release-candidate material at rc3. A workaround exists and is verified in the 11-09 comment above.Proposed release-note text:
One interaction worth stating next to it: the restriction is enforced by the new agent image, so it starts on an agent the first time that agent restarts after the upgrade. #4602 (#4483) adds an alert asking operators to restart agents still on the old image, so a fleet restart after upgrading is the moment affected schedules stop doing their work. The note should sit beside the upgrade's "restart the fleet" step.
vybe commentedon Nov 16, 2026
Ruling for v1.0.5 (operator, 2026-11-16): ship with a release note, fix in the next release.
The fix (#4427) is a large draft stacked on another draft (#4425), with a UI sign-off still owed. That is not release-candidate material. A verified workaround exists (the 11-09 comment): the agent's owner or an admin deletes and re-creates the schedule.
The release note uses the text proposed in the 11-15 comment above and sits beside the upgrade's "restart the fleet" step, since the restriction starts on an agent the first time it restarts on the new image.
Stays P1 for the next release. Row B9 of abilityai/trinity-enterprise#1189 can close on this ruling.
AndriiPasternak31 commentedon Nov 18, 2026
This issue closes with the schedule run-tier fix in #4648, which is planned for the next release (it stays P1 until then, per the 2026-11-16 ruling). A schedule whose runs do not get owner tier now says so: on every schedule read, in the hook's refusal text, on each restricted run, and as one owner alert per creator. An owner or admin can take the schedule over in place, and Gemini/Codex schedules that could not run are refused at create and enable. Continuation turns of a restricted run carry the same text and stamp.
One part does not ship here: the count of tool calls the hook refused during a run. That count needs the guardrail event store from #4425, so it moves to #4647 and lands after #4425. Until then, the restricted-run marker says the run lacked shell access, but not whether any tool call was actually refused.
#4427 is replaced by #4648.
fix(schedules): a schedule row's action icons wrap below its text whe…
fix(schedules): a refused toggle, delete or run says the server's rea…
Merge origin/dev into the #4281 run-tier branch
merge-train: take-over route reads the schedule off the event loop (#…
fix(schedules): a schedule says what tier its runs get, the owner can…
test(guardrails): the turn-tier spool tests stub the four-value turn …
feat(guardrails): guardrail events reach the platform with fleet coun…
fix(access): a read narrowed by a running turn says so, and the route…