The open source coding agent.
TypeScript
Fix issue: Option to update username shown in conversations. (#975)
opencode-agent[bot]d8bcf4f4e73c
diff --git a/opencode.json b/opencode.jsonindex 2fa644079ba..07f3581af26 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.tsindex 69ddd2accea..ce417e6b9df 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.tsindex 3c3890fc49e..53ada8a7350 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(),