`docs/jira/AUTOFIX-PR-001.md:134` documents that the AUTOFIX_PR flag
"should be added to DEFAULT_BUILD_FEATURES" but the actual addition
to scripts/defines.ts was never made. Result: every build/dev produced
an /autofix-pr command whose isEnabled() returns false (because
src/commands/autofix-pr/index.ts:9 gates on `feature('AUTOFIX_PR')`),
so the command never appeared in /help and was effectively dead code.
The flag is fork-introduced (0 references in upstream/main) so adding
it here doesn't conflict with upstream policy. Other feature() calls
the PR added (KAIROS_GITHUB_WEBHOOKS, etc.) are upstream-owned flags
where we shouldn't override the upstream default.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Both `src/commands/schedule/index.ts` (our new UI command) and the upstream
`src/skills/bundled/scheduleRemoteAgents.ts` registered `name: 'schedule'`,
producing two `/schedule` entries in the slash-command picker — one tagged
"(bundled)" with the prompt-skill description, the other our CRUD UI.
Rename the primary name to `triggers` (matches the API endpoint
`/v1/code/triggers`) and drop `'schedule'` from the alias list. `/cron`
alias is preserved. Directory stays `src/commands/schedule/` because
renaming the dir would touch every test file's import path for negligible
benefit.
Updated test that asserted the old name + alias, and the user-facing
feature guide that documented `/schedule create ...` examples.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Two clusters of pre-existing failures fixed by aligning tests with the
source they were meant to verify (not by changing source):
1. ultrareviewCommand (4 fails)
The 4 "preflight integration" tests assumed `call` makes an axios POST
and branches on `action: proceed | blocked | confirm`. That integration
was removed; the current `call` branches on `checkOverageGate()`'s four
`kind` values. Replaced with 6 tests covering each gate branch
(`not-enabled`, `low-balance`, `needs-confirm`, `proceed`), arg
pass-through to launchRemoteReview, and the null-launch failure path.
2. autonomy-lifecycle-user-flow (2 fails)
The Bun.spawn'd subprocess used cwd=tempDir, where Bun couldn't resolve
the `src/*` tsconfig path alias (it's resolved from cwd's tsconfig, not
the entrypoint file's). Switched the entrypoint to the bundled
dist/cli.js (aliases pre-resolved) and added a beforeAll that lazy-builds
the bundle if missing — handles the CI ordering where `bun test` runs
before `bun run build`.
Local: 5345/5345 pass (was 5339/5345).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Same spread+flag pattern as the axios / child_process polluters: the bare
`mock.module('dgram', () => ({ createSocket: () => mockSocket }))` leaked
the stub into every later test file in the run via Bun's last-write-wins
module mock cache. Now we spread real dgram and gate `createSocket`
through `useLanBeaconDgramStubs`, flipped on in beforeAll and off in
afterAll so unrelated UDP-using code in later suites sees real dgram.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The long-body draft-save test registered a bare `mock.module(
'node:child_process', ...)` inside the test body. Without spread+flag,
that stub leaked process-globally into every later test file in the run.
Apply the same pattern used in issue-gh / issue-template / share-* :
spread real child_process, route execFile/execFileSync through a
`useIssueLongBodyCpStubs` flag, flip on at start of test and off in
the finally block.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Bare `mock.module('axios', () => ({ default: { stubs } }))` is
process-global last-write-wins and drops `axios.create`, `request`,
`isAxiosError`, etc. that real consumers need. In CI's alphabetical
file order, that produces dozens of polluted failures (AgentsPlatformView,
schedule API, memory-stores API, etc.) that don't reproduce on WSL2.
Introduce `tests/mocks/axios.ts` with `setupAxiosMock()` — `require('axios')`
inside the factory, spread real shape, route each verb through a per-suite
`useStubs` flag. beforeAll flips on, afterAll flips off; the spread
fall-through eliminates cross-file leakage.
Refactored 12 axios mockers in tests/, plus the bare `@anthropic/ink` mocks
in ultrareviewCommand and onboarding suites (same pollution pattern broke
AgentsPlatformView's Box/Text rendering).
Verified: 5339/5345 tests pass locally; remaining 6 failures are
pre-existing isolation issues unrelated to this change.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
When ANTHROPIC_BASE_URL points to a non-Anthropic endpoint (e.g.
DeepSeek), the JSON-formatted user_id containing {, ", : characters
fails validation against ^[a-zA-Z0-9_-]+$. Send only the hex device_id
for third-party providers.
Add ImageLimits type and plumb optional limits through the chain:
callMCPTool/callMCPToolWithUrlElicitationRetry -> processMCPResult ->
transformMCPResult -> transformResultContent -> maybeResizeAndDownsampleImageBuffer.
When provided, limits override the module-level defaults
(IMAGE_TARGET_RAW_SIZE, IMAGE_MAX_WIDTH, IMAGE_MAX_HEIGHT,
API_IMAGE_MAX_BASE64_SIZE) inside maybeResizeAndDownsampleImageBuffer.
When undefined, behavior is unchanged for current callers.
Add _meta preservation in the text-block case of transformResultContent
(only when the caller opts in via includeMeta=true). transformMCPResult
passes includeMeta=true on the tool-result path; the prompt-handler call
site keeps the default false, preserving prior behavior.
Add skipLargeOutput early-return in processMCPResult after the IDE check:
when the caller passes skipLargeOutput=true and the content has no images,
the function returns content directly without large-output handling.
Add unwrap-to-text in processMCPResult for the persisted-content path:
when the large-string format gate is enabled
(MCP_TRUNCATION_PROMPT_OVERRIDE env var, or
tengu_mcp_subagent_prompt Statsig gate), and the content is a single
bare text block (no annotations, no _meta), unwrap to raw text and
switch the format description to 'Plain text'. Default-off; gate-off
behavior is unchanged.
Verified structurally against the 2.1.128 binary: function signatures,
the IDE check, gate logic, _meta-unwrap pattern, and imageLimits
plumbing match this implementation.
The buildDiffableContent and buildPrevDiffableContent fields were closures
capturing full system prompt and tool schema arrays (~300KB each). With 10
map entries × 2 closures, this held ~6MB of GC-unreachable memory.
Since recordPromptState already serializes the same data for hashing,
pre-computing the diffable content string has negligible marginal cost.
- Help General 页添加 3 步 Getting started 引导,替代单段描述
- 权限对话框底部 "Esc to cancel" → "Esc to reject","Tab to amend" → "Tab to add feedback"
- .claude/ 文件夹权限选项标签从 60 字符缩至 49 字符,避免窄终端截断
- 新增 10 个测试覆盖权限提示文案和帮助页引导内容
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>