Skip to content
Merged
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
6 changes: 6 additions & 0 deletions .changeset/tenant-settings-and-wire-url.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@truefoundry/trueforge': patch
'@truefoundry/trueforge-ui': patch
---

Document tenant-wide web search and memory switches, clarify those Settings descriptions, and keep query strings intact when the TrueForge MCP server calls list-style API tools.
11 changes: 10 additions & 1 deletion docs/docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,16 @@
"pages": [
{
"group": "Initial Setup",
"pages": ["harness/initial-setup", "models", "mcp-servers", "web-search", "memory", "skills", "sandbox"]
"pages": [
"harness/initial-setup",
"models",
"mcp-servers",
"web-search",
"memory",
"skills",
"sandbox",
"tenant-settings"
]
},
"create-agent/overview",
"agent-library",
Expand Down
4 changes: 4 additions & 0 deletions docs/harness/initial-setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ When unset, TrueForge uses the catalogs shipped with the server.

With [login / OIDC](/authentication/overview) enabled, only users with the **admin** role can open and change Settings. Everyone can still chat and use agents. Without OIDC (typical local mode), Settings are open to whoever can reach the server.

## Tenant settings

Admins can also turn [web search](/web-search) and [memory](/memory) on or off for the whole tenant. In TrueFoundry mode each tenant has its own switches. See [Tenant Settings](/tenant-settings).

## Next step

Once models (and any connectors, web search, memory, skills, or sandbox you need) are configured, [create an agent](/create-agent/overview).
2 changes: 1 addition & 1 deletion docs/memory.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ One provider is active at a time. API and UI reads redact the key, so when you u

## Turn memory on for the tenant

**Settings → Memory → Allow memory** is the tenant-wide switch, and it is off by default. Agents keep their own memory setting while it is off, so turning the switch back on restores memory for them without editing each agent. See [Turning memory off](#turning-memory-off) for what changes while it is off.
**Settings → Memory → Allow memory** is the tenant-wide switch, and it is on by default. Agents keep their own memory setting while it is off, so turning the switch back on restores memory for them without editing each agent. In TrueFoundry mode this switch is [per tenant](/tenant-settings). See [Turning memory off](#turning-memory-off) for what changes while it is off.

## Enable memory on an agent

Expand Down
24 changes: 24 additions & 0 deletions docs/tenant-settings.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
title: 'Tenant Settings'
sidebarTitle: 'Tenant Settings'
description: 'Enable or disable certain features tenant-wide.'
---

Tenant settings are admin switches that allow or block a capability for everyone in the tenant. They sit above each agent's own toggles: an agent can only use a capability when the tenant allows it and a provider is configured.

In **TrueFoundry mode**, these settings are **per tenant**. Each tenant admin opens **Settings** and changes only their tenant's switches; provider catalogs stay platform-managed.

## Available settings

| Setting | Where | Default | What it controls |
| --- | --- | --- | --- |
| **Allow web search** | **Settings → Web search** | On | Whether new chats and agents may turn on [web search](/web-search). Chats that already use it keep it. |
| **Allow memory** | **Settings → Memory** | On | Whether agents may use [memory](/memory). Turning it off also stops memory in existing chats. |

Only admins can change these switches. In TrueFoundry mode, a tenant admin can open the Web search and Memory sections for the switches even when they cannot edit providers.

## Manage through the API

- `GET /api/v1/settings/configuration` reads the tenant switches.
- `PATCH /api/v1/settings/configuration` updates one or both, for example `{ "manifest": { "web_search": { "enabled": false }, "memory": { "enabled": true } } }`.
- `GET /api/v1/capabilities` reports whether web search and memory are available to agents, including when a tenant switch is off.
5 changes: 5 additions & 0 deletions docs/web-search.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ The list comes from the shipped [`web-search-catalog.yaml`](https://github.com/t

One provider is active at a time. API and UI reads redact the key, so when you update the provider later, leave the API key blank to keep the stored value, or enter a new key to rotate it.

## Turn web search on for the tenant

**Settings → Web search → Allow web search** is the tenant-wide switch, and it is on by default. While it is off, new chats and agents cannot enable web search; chats that already use it keep it. In TrueFoundry mode this switch is [per tenant](/tenant-settings).

## Enable web search on an agent

| Where | How |
Expand Down Expand Up @@ -48,4 +52,5 @@ An MCP server with search tools works as well, and the [Quickstart](/quickstart)
- `GET /api/v1/settings/web-search-providers` reads the provider, with the key redacted.
- `PUT /api/v1/settings/web-search-providers` creates, replaces, or rotates the key.
- `GET /api/v1/catalogs/web-search-providers` lists the presets.
- `PATCH /api/v1/settings/configuration` with `{ "manifest": { "web_search": { "enabled": true } } }` turns web search on for the tenant.
- `GET /api/v1/capabilities` reports whether web search is available.
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ const MemorySettings = () => {
<>
<h3 className="text-xl font-semibold tracking-tight text-text-primary">Memory</h3>
<p className="mt-1 text-sm text-text-secondary">
Choose whether agents in this tenant may remember details from past chats.
Let TrueForge personalize your conversations based on your past chats.
</p>

{error ? (
Expand All @@ -197,8 +197,8 @@ const MemorySettings = () => {
<h4 className="text-sm font-medium text-text-primary">Allow memory</h4>
<p className="mt-0.5 text-xs text-text-secondary">
{tenantEnabled
? 'Agents with memory turned on remember details from past chats.'
: 'No agent remembers details from past chats.'}
? 'Agents may remember details from past chats.'
: 'Agents cannot use memory, including in chats that already had it.'}
</p>
</div>
<Switch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ const WebSearchSettings = () => {
return (
<>
<h3 className="text-xl font-semibold tracking-tight text-text-primary">Web search</h3>
<p className="mt-1 text-sm text-text-secondary">Choose whether agents in this tenant may search the web.</p>
<p className="mt-1 text-sm text-text-secondary">Let agents search the web and fetch page content.</p>

{error ? (
<p className="mt-3 rounded-md border border-failure-bg/30 bg-failure-bg/10 px-3 py-2 text-sm text-failure-bg">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ describe('MemorySettings tenant switch', () => {

const toggle = await screen.findByRole('switch', { name: 'Allow memory' });
expect(toggle).toHaveAttribute('aria-checked', 'false');
expect(screen.getByText('No agent remembers details from past chats.')).toBeInTheDocument();
expect(screen.getByText('Agents cannot use memory, including in chats that already had it.')).toBeInTheDocument();
});

it('saves only the memory switch and re-renders from the response', async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/trueforge/src/mcp/server/trueforge/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export function createTrueForgeMcpRouter(deps: TrueForgeMcpRouterDeps): Hono {
...(requestContext.user_credential === null ? { auth: false } : { token: requestContext.user_credential }),
fetch: internalFetch,
});
const client = createWireApiClient(apiClient);
const client = createWireApiClient(apiClient, baseUrl);
const server = createTrueForgeMcpServer({ client, version: deps.version, tools: deps.resolveTools() });
const transport = new WebStandardStreamableHTTPServerTransport({
enableJsonResponse: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export interface WireApiClient {
}

/** Map generated tool arguments onto raw SDK passthrough requests. */
export function createWireApiClient(client: Pick<TrueForge, 'fetch'>): WireApiClient {
export function createWireApiClient(client: Pick<TrueForge, 'fetch'>, baseUrl: string): WireApiClient {
Comment thread
heerambavi1998 marked this conversation as resolved.
Resolved
return {
async execute(descriptor, args, signal) {
let pathname = descriptor.path;
Expand Down Expand Up @@ -80,9 +80,12 @@ export function createWireApiClient(client: Pick<TrueForge, 'fetch'>): WireApiCl
headers.set('content-type', 'application/json');
}

const queryString = query.toString();
// Resolve an absolute URL here. The SDK passthrough fetch appends a relative path onto the
// base pathname, which percent-encodes `?` and turns the query string into part of the route.
const url = new URL(pathname, baseUrl);
url.search = query.toString();
const response = await client.fetch(
queryString.length === 0 ? pathname : `${pathname}?${queryString}`,
url,
{
method: descriptor.method,
headers,
Expand Down
Loading