# withAgentConfigLock

<!-- https://uncage.vercel.app/docs/api/agent/functions/withagentconfiglock/ -->

```ts
function withAgentConfigLock<T>(home, fn): Promise<T>;
```

Defined in: agent/src/config.ts:202

Serializes read-modify-write of agent.yaml across processes (the CLI and the running agent):
an exclusive `agent.yaml.lock` file, broken when older than 10 s.

## Type Parameters

| Type Parameter |
| ------ |
| <a id="type-parameter-t"></a> `T` |

## Parameters

| Parameter | Type |
| ------ | ------ |
| `home` | `string` |
| `fn` | () => `Promise`\<`T`\> |

## Returns

`Promise`\<`T`\>
