Agent: answer status on the central server itself
Central servers only get the agent (install.sh --central), not the crosscode script, but a central agent accepts status jobs and ran `crosscode status` for them, which failed with `spawn /usr/local/bin/crosscode ENOENT`. A central agent now reports its own stats (frps and the agent version) for status; church servers still run crosscode status. Also ignores temp/ (local screenshots). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -159,6 +159,15 @@ export class Agent {
|
||||
}
|
||||
case "export":
|
||||
return await this.runExport(job, limit);
|
||||
case "status":
|
||||
// The central server has no crosscode script (install.sh --central): its status is the
|
||||
// agent's own stats, with frps.
|
||||
if (this.deps.config.mode === "central") {
|
||||
const stats = await (this.deps.stats ?? (() => collectStats("central")))();
|
||||
const warning = stats.central && !stats.central.frpsRunning ? "frps isn't running." : undefined;
|
||||
return { status: "succeeded", steps: [], result: { stats } as unknown as Record<string, unknown>, message: warning, log: [], startedAt, finishedAt: new Date().toISOString() };
|
||||
}
|
||||
return await this.run(crosscodeArgs(job)!, job, limit);
|
||||
default: {
|
||||
const args = crosscodeArgs(job);
|
||||
if (!args) throw new Error(`No command for ${job.type}`);
|
||||
|
||||
@@ -12,7 +12,7 @@ import { paths } from "./paths";
|
||||
* the tools that are there; anything missing is null rather than an error.
|
||||
*/
|
||||
|
||||
export const AGENT_VERSION = "1.0.0";
|
||||
export const AGENT_VERSION = "1.0.1";
|
||||
|
||||
function run(cmd: string, args: string[], timeoutMs = 10_000): Promise<string | null> {
|
||||
return new Promise((resolve) => {
|
||||
|
||||
Reference in New Issue
Block a user