fix: keep question order and streamline contextual help
GoodBuddy Agents / Validate Agent source (push) Canceled after 0s
GoodBuddy Agents / Build darwin arm64 Agent (push) Canceled after 0s
GoodBuddy Agents / Build linux arm64 Agent (push) Canceled after 0s
GoodBuddy Agents / Build linux x64 Agent (push) Canceled after 0s
Cross-platform packages / Validate source (push) Canceled after 0s
Cross-platform packages / Authorize desktop packaging (push) Canceled after 0s
Cross-platform packages / linux arm64 (push) Canceled after 0s
Cross-platform packages / macos arm64 (push) Canceled after 0s
Cross-platform packages / windows arm64 (push) Canceled after 0s
Cross-platform packages / linux x64 (push) Canceled after 0s
Cross-platform packages / macos x64 (push) Canceled after 0s
Cross-platform packages / windows x64 (push) Canceled after 0s
Cross-platform packages / Publish GitHub and OSS release (push) Canceled after 0s
GoodBuddy Agents / Validate Agent source (push) Canceled after 0s
GoodBuddy Agents / Build darwin arm64 Agent (push) Canceled after 0s
GoodBuddy Agents / Build linux arm64 Agent (push) Canceled after 0s
GoodBuddy Agents / Build linux x64 Agent (push) Canceled after 0s
Cross-platform packages / Validate source (push) Canceled after 0s
Cross-platform packages / Authorize desktop packaging (push) Canceled after 0s
Cross-platform packages / linux arm64 (push) Canceled after 0s
Cross-platform packages / macos arm64 (push) Canceled after 0s
Cross-platform packages / windows arm64 (push) Canceled after 0s
Cross-platform packages / linux x64 (push) Canceled after 0s
Cross-platform packages / macos x64 (push) Canceled after 0s
Cross-platform packages / windows x64 (push) Canceled after 0s
Cross-platform packages / Publish GitHub and OSS release (push) Canceled after 0s
Keep interactive questions and answered cards at their original position in conversation history, including remote reception, recovery, and reopening. Preserve legacy history placement without a database migration. Move supplementary guidance into shared accessible contextual-help popovers across pages and settings. Add keyboard, modal, accessibility, and Electron regressions, plus bounded opt-in live canvas-analysis validation. Remove unused Agent, Runtime, and in-memory graph-search helpers, obsolete mocks and browser copy; reuse the existing package-size formatter. Keep production execution paths, protocol schemas, and released data migrations. Validation: targeted cleanup tests, typecheck, lint, shared Linux Host attach/read/re-attach, and added help/Electron checks passed. Final full-suite verification passed 4,858 tests with 67 skipped and zero failures (412 files passed, 9 skipped). Focused help checks passed 54 tests, including Electron style comparisons and Chromium accessibility descriptions. Details and validation boundaries are recorded in feature docs. Release note: 修复交互式问答在回答后排到后续输出末尾的问题,重新打开会话仍保留提问位置。页面和设置中的补充说明改为标题或字段旁的按需帮助,支持鼠标与键盘操作。
This commit is contained in:
@@ -465,14 +465,3 @@ function mergeProtocolMethods(
|
||||
}
|
||||
return { ...workspaceMethods, ...runtimeMethods }
|
||||
}
|
||||
|
||||
export class UnsupportedPeerIdentityProvider
|
||||
implements UnixPeerIdentityProvider
|
||||
{
|
||||
async getPeerIdentity(): Promise<never> {
|
||||
throw new AgentUnsupportedError(
|
||||
'A certified SO_PEERCRED helper is unavailable',
|
||||
'peer-identity-unavailable'
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,6 @@ export * from './runtime-acp-backend'
|
||||
export * from './runtime-owner-registry'
|
||||
export * from './runtime-process-identity'
|
||||
export * from './semantic-prompt-store'
|
||||
export * from './structured-command-runner'
|
||||
export * from './workspace-git-service'
|
||||
export * from './workspace-path-access'
|
||||
export * from './workspace-protocol-methods'
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import {
|
||||
lstatSync,
|
||||
readFileSync,
|
||||
readlinkSync,
|
||||
realpathSync
|
||||
@@ -115,25 +114,6 @@ export class LinuxProcessInspector {
|
||||
}
|
||||
}
|
||||
|
||||
export function currentLinuxProcessIdentity(
|
||||
options: LinuxProcessInspectorOptions = {}
|
||||
): LinuxProcessIdentity {
|
||||
const identity = new LinuxProcessInspector(options).inspect(process.pid)
|
||||
if (identity === undefined) {
|
||||
throw new Error('Current Linux process identity is unavailable')
|
||||
}
|
||||
return identity
|
||||
}
|
||||
|
||||
export function canonicalExecutablePath(path: string): string {
|
||||
const normalized = assertAbsoluteManagedPath(resolve(path))
|
||||
const stat = lstatSync(normalized)
|
||||
if (stat.isSymbolicLink() || !stat.isFile()) {
|
||||
throw new Error('Agent executable must be a regular file')
|
||||
}
|
||||
return assertAbsoluteManagedPath(realpathSync(normalized))
|
||||
}
|
||||
|
||||
function parseStarttime(contents: string): string {
|
||||
const close = contents.lastIndexOf(')')
|
||||
if (close < 2 || contents[close + 1] !== ' ') {
|
||||
|
||||
@@ -1,182 +0,0 @@
|
||||
import { spawn } from 'node:child_process'
|
||||
|
||||
export type SpawnResult = {
|
||||
exitCode: number
|
||||
stdout: string
|
||||
stderr: string
|
||||
signal?: NodeJS.Signals
|
||||
terminationReason?: 'timeout' | 'aborted'
|
||||
}
|
||||
|
||||
export type StructuredCommandOptions = {
|
||||
env?: Readonly<NodeJS.ProcessEnv>
|
||||
signal?: AbortSignal
|
||||
timeoutMs?: number
|
||||
terminationGraceMs?: number
|
||||
}
|
||||
|
||||
export interface StructuredCommandRunner {
|
||||
run(
|
||||
executable: string,
|
||||
args: readonly string[],
|
||||
options?: StructuredCommandOptions
|
||||
): Promise<SpawnResult>
|
||||
}
|
||||
|
||||
const DEFAULT_COMMAND_TIMEOUT_MS = 30_000
|
||||
const MAXIMUM_COMMAND_TIMEOUT_MS = 120_000
|
||||
const DEFAULT_TERMINATION_GRACE_MS = 1_000
|
||||
const MAXIMUM_TERMINATION_GRACE_MS = 10_000
|
||||
|
||||
export class NodeStructuredCommandRunner implements StructuredCommandRunner {
|
||||
async run(
|
||||
executable: string,
|
||||
args: readonly string[],
|
||||
options: StructuredCommandOptions = {}
|
||||
): Promise<SpawnResult> {
|
||||
const timeoutMs = boundedDuration(
|
||||
options.timeoutMs ?? DEFAULT_COMMAND_TIMEOUT_MS,
|
||||
'Command timeout',
|
||||
MAXIMUM_COMMAND_TIMEOUT_MS
|
||||
)
|
||||
const terminationGraceMs = boundedDuration(
|
||||
options.terminationGraceMs ?? DEFAULT_TERMINATION_GRACE_MS,
|
||||
'Command termination grace',
|
||||
MAXIMUM_TERMINATION_GRACE_MS
|
||||
)
|
||||
if (options.signal?.aborted === true) {
|
||||
return {
|
||||
exitCode: -1,
|
||||
stdout: '',
|
||||
stderr: '',
|
||||
terminationReason: 'aborted'
|
||||
}
|
||||
}
|
||||
return await new Promise<SpawnResult>((resolveResult) => {
|
||||
const child = spawn(executable, [...args], {
|
||||
shell: false,
|
||||
windowsHide: true,
|
||||
stdio: ['ignore', 'pipe', 'pipe'],
|
||||
...(options.env === undefined ? {} : { env: options.env })
|
||||
})
|
||||
const stdout: Buffer[] = []
|
||||
const stderr: Buffer[] = []
|
||||
let stdoutBytes = 0
|
||||
let stderrBytes = 0
|
||||
const maximumBytes = 64 * 1024
|
||||
let settled = false
|
||||
let terminationReason: SpawnResult['terminationReason']
|
||||
const timeout = setTimeout(() => terminate('timeout'), timeoutMs)
|
||||
let escalation: NodeJS.Timeout | undefined
|
||||
let closeDeadline: NodeJS.Timeout | undefined
|
||||
let spawnError: Error | undefined
|
||||
child.stdout.on('data', (chunk: Buffer) => {
|
||||
if (stdoutBytes < maximumBytes) {
|
||||
const bounded = chunk.subarray(0, maximumBytes - stdoutBytes)
|
||||
stdout.push(bounded)
|
||||
stdoutBytes += bounded.byteLength
|
||||
}
|
||||
})
|
||||
child.stderr.on('data', (chunk: Buffer) => {
|
||||
if (stderrBytes < maximumBytes) {
|
||||
const bounded = chunk.subarray(0, maximumBytes - stderrBytes)
|
||||
stderr.push(bounded)
|
||||
stderrBytes += bounded.byteLength
|
||||
}
|
||||
})
|
||||
const finish = (
|
||||
exitCode: number | null,
|
||||
signal: NodeJS.Signals | null
|
||||
): void => {
|
||||
if (settled) {
|
||||
return
|
||||
}
|
||||
settled = true
|
||||
clearTimeout(timeout)
|
||||
if (escalation !== undefined) {
|
||||
clearTimeout(escalation)
|
||||
}
|
||||
if (closeDeadline !== undefined) {
|
||||
clearTimeout(closeDeadline)
|
||||
}
|
||||
options.signal?.removeEventListener('abort', abort)
|
||||
const capturedStderr = Buffer.concat(stderr).toString('utf8')
|
||||
resolveResult({
|
||||
exitCode: exitCode ?? -1,
|
||||
stdout: Buffer.concat(stdout).toString('utf8'),
|
||||
stderr:
|
||||
capturedStderr ||
|
||||
(spawnError === undefined ? '' : spawnError.message),
|
||||
...(signal === null ? {} : { signal }),
|
||||
...(terminationReason === undefined ? {} : { terminationReason })
|
||||
})
|
||||
}
|
||||
const terminate = (
|
||||
reason: NonNullable<SpawnResult['terminationReason']>
|
||||
): void => {
|
||||
if (settled || terminationReason !== undefined) {
|
||||
return
|
||||
}
|
||||
terminationReason = reason
|
||||
if (child.exitCode !== null || child.signalCode !== null) {
|
||||
return
|
||||
}
|
||||
child.kill('SIGTERM')
|
||||
escalation = setTimeout(() => {
|
||||
if (
|
||||
settled ||
|
||||
child.exitCode !== null ||
|
||||
child.signalCode !== null
|
||||
) {
|
||||
return
|
||||
}
|
||||
child.kill('SIGKILL')
|
||||
closeDeadline = setTimeout(
|
||||
() => finish(child.exitCode, child.signalCode),
|
||||
terminationGraceMs
|
||||
)
|
||||
}, terminationGraceMs)
|
||||
}
|
||||
const abort = (): void => terminate('aborted')
|
||||
child.once('error', (error) => {
|
||||
spawnError = error
|
||||
})
|
||||
child.once('close', finish)
|
||||
options.signal?.addEventListener('abort', abort, { once: true })
|
||||
if (options.signal?.aborted === true) {
|
||||
abort()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export function formatSpawnFailure(
|
||||
command: string,
|
||||
result: SpawnResult
|
||||
): string {
|
||||
const status =
|
||||
result.terminationReason === 'timeout'
|
||||
? 'timed out'
|
||||
: result.terminationReason === 'aborted'
|
||||
? 'was cancelled'
|
||||
: result.signal !== undefined
|
||||
? `terminated by ${result.signal}`
|
||||
: `exited with status ${result.exitCode}`
|
||||
return `${command} ${status}: ${boundedError(result.stderr)}`
|
||||
}
|
||||
|
||||
function boundedDuration(
|
||||
value: number,
|
||||
name: string,
|
||||
maximum: number
|
||||
): number {
|
||||
if (!Number.isSafeInteger(value) || value <= 0 || value > maximum) {
|
||||
throw new Error(`${name} must be between 1 and ${maximum} milliseconds`)
|
||||
}
|
||||
return value
|
||||
}
|
||||
|
||||
function boundedError(error: string): string {
|
||||
const normalized = error.replaceAll(/\s+/gu, ' ').trim()
|
||||
return normalized.slice(0, 1000) || 'unknown error'
|
||||
}
|
||||
Reference in New Issue
Block a user