feat(i18n): add response_language config for cross-phase language consistency (#1412)

* feat(i18n): add response_language config for cross-phase language consistency

Adds `response_language` config key that propagates through all init
outputs via withProjectRoot(). Workflows read this field and instruct
agents to present user-facing questions in the configured language,
solving the problem of language preference resetting at phase boundaries.

Usage: gsd-tools config-set response_language "Portuguese"

Closes #1399

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* test(security): allowlist discuss-phase.md for size threshold

discuss-phase.md legitimately exceeds 50K chars due to power mode
and i18n directives — not prompt stuffing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Tibsfox
2026-04-04 04:49:10 -07:00
committed by GitHub
parent 9d626de5fa
commit dc2afa299b
10 changed files with 58 additions and 3 deletions

View File

@@ -29,6 +29,7 @@ const VALID_CONFIG_KEYS = new Set([
'hooks.context_warnings',
'project_code', 'phase_naming',
'manager.flags.discuss', 'manager.flags.plan', 'manager.flags.execute',
'response_language',
]);
/**

View File

@@ -357,6 +357,7 @@ function loadConfig(cwd) {
model_overrides: parsed.model_overrides || null,
agent_skills: parsed.agent_skills || {},
manager: parsed.manager || {},
response_language: get('response_language') || null,
};
} catch {
return defaults;

View File

@@ -37,6 +37,13 @@ function withProjectRoot(cwd, result) {
const agentStatus = checkAgentsInstalled();
result.agents_installed = agentStatus.agents_installed;
result.missing_agents = agentStatus.missing_agents;
// Inject response_language into all init outputs (#1399).
// Workflows propagate this to subagent prompts so user-facing questions
// stay in the configured language across phase boundaries.
const config = loadConfig(cwd);
if (config.response_language) {
result.response_language = config.response_language;
}
return result;
}