summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authoropencode-agent[bot] <219766164+opencode-agent[bot]@users.noreply.github.com>2025-07-14 11:03:04 -0400
committerGitHub <[email protected]>2025-07-14 11:03:04 -0400
commitd8bcf4f4e73c085d67d5cf2c9759d5142a663582 (patch)
tree04f939b9f214187233c81ef7a404569fe6324596
parent31e0326f78976f4d45dea8f44ca6e1f6faeb078b (diff)
downloadopencode-d8bcf4f4e73c085d67d5cf2c9759d5142a663582.tar.gz
opencode-d8bcf4f4e73c085d67d5cf2c9759d5142a663582.zip
Fix issue: Option to update username shown in conversations. (#975)
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com> Co-authored-by: thdxr <[email protected]>
-rw-r--r--opencode.json1
-rw-r--r--packages/opencode/src/app/app.ts6
-rw-r--r--packages/opencode/src/config/config.ts1
3 files changed, 7 insertions, 1 deletions
diff --git a/opencode.json b/opencode.json
index 2fa644079..07f3581af 100644
--- a/opencode.json
+++ b/opencode.json
@@ -1,5 +1,6 @@
{
"$schema": "https://opencode.ai/config.json",
+ "username": "testuser",
"mcp": {
"weather": {
"type": "local",
diff --git a/packages/opencode/src/app/app.ts b/packages/opencode/src/app/app.ts
index 69ddd2acc..ce417e6b9 100644
--- a/packages/opencode/src/app/app.ts
+++ b/packages/opencode/src/app/app.ts
@@ -69,8 +69,12 @@ export namespace App {
const root = git ?? input.cwd
+ // Load config to get custom username if set
+ const { Config } = await import("../config/config")
+ const config = await Config.global()
+
const info: Info = {
- user: os.userInfo().username,
+ user: config.username || os.userInfo().username,
hostname: os.hostname(),
time: {
initialized: state.initialized,
diff --git a/packages/opencode/src/config/config.ts b/packages/opencode/src/config/config.ts
index 3c3890fc4..53ada8a73 100644
--- a/packages/opencode/src/config/config.ts
+++ b/packages/opencode/src/config/config.ts
@@ -122,6 +122,7 @@ export namespace Config {
autoupdate: z.boolean().optional().describe("Automatically update to the latest version"),
disabled_providers: z.array(z.string()).optional().describe("Disable providers that are loaded automatically"),
model: z.string().describe("Model to use in the format of provider/model, eg anthropic/claude-2").optional(),
+ username: z.string().optional().describe("Custom username to display in conversations instead of system username"),
mode: z
.object({
build: Mode.optional(),