feat: add tenant-configured Ticket Agents and result tools - #576
LikiosSedo wants to merge 10 commits into
Conversation
55b9465 to
015f32a
Compare
7476deb to
dfe0525
Compare
a3f072f to
d569815
Compare
|
Deep review of the SSE client, the two result contracts and the skill. The stream handling and the schema are in good shape — notes below are three narrower points, one of which is a behavioural question rather than a defect. 1. An observation callback can kill the run
} else if (event === "chat.event") {
if (!session || !object(value)) throw new RunError("RUN_CHAT_SEQUENCE", false);
options.onChatEvent?.(value);
}
Either wrap the call, or state in 2. A frame without an explicit
|
d166555 to
d744794
Compare
|
Follow-up review of the force-pushed revision ( 1. Status of the earlier three points(a) An observation callback can kill the run — resolved. (c) Final (b) A frame without an explicit Unrelated note on 2. Blocking question: which server emits these frames?I cannot review roughly half of What is in this tree today:
So against this repo's server, If the target is an external gateway, that is fine, but 3. Must fix before merge3.1 3.2 Worth noting the fix is not a straight copy of the sibling: 3.3 I would also fold in 4.1 below, because a reference implementation gets copied. 4. Other findings4.1 A privileged control prefix on the untrusted channel. 4.2 A correct draft citing the ticket is rejected in every acceptance case. 4.3 4.4 A data-less terminal frame is swallowed and reported as an interruption. 4.5 An empty 4.6 4.7 Cancel and deadline are indistinguishable. 4.8 4.9 The smoke script discards the only field that identifies a failure. 4.10 The 4.11 The 256 KiB context bound is measured before the second escaping. 4.12 Frame assembly is quadratic in chunks per frame. 4.13 Neither 4.14 Output language is undefined, and the two documented request shapes disagree. 4.15 Two conventions for the same job. 5. What looks clean
6. Suggested shape
Almost everything else lives under |
|
@jacoblee-io Follow-up on your review, checked against current head
The latest follow-up also closes the metadata-only ticket citation gap: a ticket ID/title/status alone is not citable content; the client requires a supplied description or an explicit ticket record. Invalid review input now rejects the returned Promise before any request. CI covers strict example/smoke type checking and independent installs/builds of both result MCP packages; smoke output includes RunError codes. The product scope is two independently configured Custom instances: pre-ticket support/intake and post-closure retrospective review. The reusable pieces are stateless result validation, evidence references, instance-owned prompts/resources, and correlated terminal result consumption. These MCPs do not create or close tickets, fetch business records, persist a review, or perform automatic retries. The ticket application owns those actions, completion-revision deduplication, and human corrections. Current validation: all six CI checks pass; local backend tests pass 378 files / 7,646 tests with one existing skip. Live provider and deployment acceptance were not repeated for this revision. Please recheck against this head; a remaining issue should identify the supported host protocol or instance configuration and the failing input so we can reproduce it on the same contract. |
|
Thanks — your reply answers the blocking question, and it also made me recheck my own list. Three of my findings were wrong; corrections first, then what actually remains. Corrections — please ignore these three4.9 (smoke discards the failure code) — wrong. 4.13 (CI does not typecheck 4.14, second half (the two documented request shapes disagree) — withdrawn. Cause, for what it is worth: Answered or downgraded by your reply§2 / 3.3 — answered. "The host's strict 4.4 and 4.5 (data-less 4.6 — narrowed. The What still standsNone of these depends on the host protocol. 3.1 — 3.2 — 4.2 — a ticket citation is unreachable in every acceptance case, and the rule is never shown to the model. I agree the rule is deliberate, and 4.3 — 4.1 — 4.15 — 4.7 — cancel and deadline are indistinguishable. 4.8 — 4.10 — 4.11 — the 256 KiB context bound is measured before the second escaping. 4.12 — frame assembly is quadratic in chunks per frame. 4.14, first half — output language is never actually requested. Minor, new: Priority3.1 and 3.2 are the two I would gate merge on — 3.1 changes an image every agent runs, 3.2 can make the required result tool fail to register. 4.1 and 4.2 next. The rest are fine as follow-ups. |
d744794 to
f4d71e6
Compare
|
@jacoblee-io Thanks for the follow-up and corrections. Here is the intended product model, as implemented by the Ticket-type follow-up at One Ticket Agent type; tenant-configured business instances. A tenant creates two instances of that type, for example Support Intake and Ticket Retrospective. Each instance has its own editable business prompt, bound Skills/knowledge/MCPs, result tool and API key. The platform does not encode those two business roles as separate types or subtypes.
Why binding alone is insufficient: binding an MCP makes its tools available. Designating one as the result tool tells the platform what must succeed before this turn is considered complete. The Ticket type makes that designation mandatory, so its configuration has no “require structured output” opt-out. Ordinary Custom configuration stays generic; existing Custom result contracts remain compatible. Prompts remain tenant-owned. Tenants can replace the business instructions in the instance editor. The platform's tool boundary and completion checks remain code-enforced. AgentBox rejects Ticket prompts when the required result-tool name is absent or the tool is not actually loaded; the host validates the correlated result and terminal sequence. A type/model release must not overwrite the tenant's business prompt or inject shared business resources. The two example workflows intentionally stop at a result: support prepares intake/handoff material, and retrospective review produces an evidence-linked draft. Neither result MCP creates tickets or writes a retrospective to a business database. The supported configuration path is the integrated host's tenant UI. Runtime and AgentBox support must be deployed before the host enables the type. The standalone Portal does not currently offer Ticket creation because it does not configure instance result contracts. This design explanation does not resolve implementation findings by itself. Skill distribution versus instance activation, provider-facing schema compatibility, and model-facing evidence instructions should still be reviewed against these boundaries. Packaging a reusable asset must not be mistaken for requiring every Agent to perform its workflow. The new type has local service/Runtime tests, but real-provider and deployed tenant acceptance remain pending. Reference: Ticket runtime contract and instance configuration examples. |
|
Thanks — the ownership table settles the boundary questions, and I am not reopening anything we have aligned on. This is a review of the new delta The headline is that the type's defining guarantee does not hold on the production path. 1. Both Ticket gates are unreachable in production
The only writer of that field is // sync-handlers.ts:869
const VALID_AGENT_TYPES = new Set(["sre", "knowledge_qa", "product_support", "custom"]);
...
// :927
if (!VALID_AGENT_TYPES.has(payload?.agentType) || ...) {
throw new Error("[tools] Invalid tool-capabilities payload");
}
target.allowedToolsState = allowed; // :931 — after the throw
Net effect on a Ticket dispatch: neither gate fires, no result tool is loaded, and the existing repair path then declines quietly. Worth noting why CI is green: 2. The PUT guard is inverted
const currentAgentType = normalizeAgentType(current.agent_type);
const nextAgentType = "agent_type" in body ? normalizeAgentType(body.agent_type) : currentAgentType;
if (nextAgentType === "ticket") { sendJson(res, 400, ...); return; }It tests the resolved next type, not the stored one, which produces both halves of the wrong behaviour:
If the intent is "the standalone Portal does not configure Ticket instances", the condition wants to be about a stored ticket type on either side of the transition, not about the resolved value. 3.
|
|
@jacoblee-io Follow-up on the Ticket-type delta review, fixed at
The QA capability changes in point 4 are already in the target main branch from #599; they are not part of this PR's current diff against main. Validation: 375 focused backend tests, five Portal settings tests, Runtime/AgentBox/example type checks, backend build and Portal production build pass. The full backend run passed 7,676 tests; two unchanged script-query tests timed out, and all 48 tests in that file passed when rerun in isolation. No deployed or real-provider acceptance is claimed. The earlier separate Skill/schema/example-policy findings are not marked resolved by this follow-up. |
|
Checked the four Ticket-delta points against Verified fixed#1 — the unreachable gates. #2 — the PUT guard. Moved to the top of the handler and now #3 — the serving-path throw. #5 — the walkthrough now names the integrated host tenant UI. Two corrections on my sideMy suggested remedy for #3 was wrong, and your reasoning is right. I proposed returning #4 was a misattribution. The Knowledge Q&A capability expansion is not in this PR: Remaining before I can approveBoth are the ones you already listed as not resolved by this follow-up, so this is a status note rather than a disagreement.
Still open but not blocking, for the record: the Fix the two above and I will approve. |
|
Superseded. Siclaw delivery has moved off this public repository; this change is continuing on the internal Siclaw repo. Closing the public PR. |
Ticket Agent instances support tenant-defined support intake and retrospective review through the same type. The host owns instance configuration and structured completion; each instance supplies its business prompt, resource bindings and required result MCP tool.
Validation: the Gateway tool-capabilities handler now feeds the real AgentBox tools materializer before the HTTP prompt test exercises missing/unavailable/ready result-tool admission. This reproduces the former unreachable Ticket state. All 375 focused backend tests and five Portal settings tests pass; Runtime, AgentBox and example strict type checks, backend build and Portal production build pass. The full backend run passed 7,676 tests; two unchanged script-query tests timed out in that run, and all 48 tests in their file passed when rerun in isolation. Public fixtures are synthetic.
The companion host must provide tenant-owned Ticket prompts/resources and a required same-tenant bound result tool, and enforce one successful structured result plus final reply before reporting completion. No subtype mechanism or business-schema allowlist is introduced. The ticket application owns record retrieval, ticket creation/closure, result storage, deduplication and human corrections.
No deployment or real-provider acceptance was performed for the Ticket type. Earlier support/review provider acceptance does not establish acceptance of this new type. See docs/design/ticket-agent-instances.md and examples/support-review/README.md for configuration and rollout.