@teamvibe/poller 0.1.19 → 0.1.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/brain-manager.d.ts +4 -0
- package/dist/brain-manager.js +24 -1
- package/dist/poller.js +2 -1
- package/package.json +1 -1
package/dist/brain-manager.d.ts
CHANGED
package/dist/brain-manager.js
CHANGED
|
@@ -5,13 +5,36 @@ import { join } from 'path';
|
|
|
5
5
|
import { config } from './config.js';
|
|
6
6
|
import { logger } from './logger.js';
|
|
7
7
|
const execAsync = promisify(exec);
|
|
8
|
-
// Clean env for git commands — npm/npx sets GIT_ASKPASS
|
|
8
|
+
// Clean env for git commands — npm/npx sets GIT_ASKPASS which
|
|
9
9
|
// prevents git credential helpers (like gh) from working.
|
|
10
10
|
const gitEnv = { ...process.env };
|
|
11
11
|
delete gitEnv['GIT_ASKPASS'];
|
|
12
12
|
function gitExec(command, options) {
|
|
13
13
|
return execAsync(command, { ...options, env: gitEnv });
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Log git auth diagnostics to help debug credential issues.
|
|
17
|
+
*/
|
|
18
|
+
export async function logGitDiagnostics() {
|
|
19
|
+
const diag = async (label, cmd) => {
|
|
20
|
+
try {
|
|
21
|
+
const { stdout } = await execAsync(cmd);
|
|
22
|
+
logger.info(`[git-diag] ${label}: ${stdout.trim()}`);
|
|
23
|
+
}
|
|
24
|
+
catch (e) {
|
|
25
|
+
logger.warn(`[git-diag] ${label}: FAILED - ${e instanceof Error ? e.message : e}`);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
logger.info(`[git-diag] GIT_ASKPASS=${process.env['GIT_ASKPASS'] ?? '(unset)'}`);
|
|
29
|
+
logger.info(`[git-diag] GIT_TERMINAL_PROMPT=${process.env['GIT_TERMINAL_PROMPT'] ?? '(unset)'}`);
|
|
30
|
+
logger.info(`[git-diag] GITHUB_TOKEN=${process.env['GITHUB_TOKEN'] ? '***set***' : '(unset)'}`);
|
|
31
|
+
logger.info(`[git-diag] HOME=${process.env['HOME'] ?? '(unset)'}`);
|
|
32
|
+
await diag('git version', 'git --version');
|
|
33
|
+
await diag('gh version', 'gh --version | head -1');
|
|
34
|
+
await diag('credential.helper', 'git config --global credential.helper || echo "(not set)"');
|
|
35
|
+
await diag('credential.github', 'git config --global --get-regexp "credential.*github" || echo "(not set)"');
|
|
36
|
+
await diag('gh auth status', 'gh auth status 2>&1 || true');
|
|
37
|
+
}
|
|
15
38
|
// Cooldown tracker per brain
|
|
16
39
|
const lastUpdateTimes = new Map();
|
|
17
40
|
/**
|
package/dist/poller.js
CHANGED
|
@@ -4,7 +4,7 @@ import { pollMessages, deleteMessage, extendVisibility, } from './sqs-poller.js'
|
|
|
4
4
|
import { spawnClaudeCode, isAtCapacity, getActiveProcessCount } from './claude-spawner.js';
|
|
5
5
|
import { sendSlackError, addReaction, getUserInfo, startTypingIndicator } from './slack-client.js';
|
|
6
6
|
import { acquireSessionLock, releaseSessionLock, updateSessionId } from './session-store.js';
|
|
7
|
-
import { getBrainPath, ensureDirectories, ensureBaseBrain, pushBrainChanges } from './brain-manager.js';
|
|
7
|
+
import { getBrainPath, ensureDirectories, ensureBaseBrain, pushBrainChanges, logGitDiagnostics } from './brain-manager.js';
|
|
8
8
|
import { initAuth, stopRefresh } from './auth-provider.js';
|
|
9
9
|
// Track active message processing
|
|
10
10
|
const processingMessages = new Set();
|
|
@@ -254,6 +254,7 @@ export async function startPoller() {
|
|
|
254
254
|
logger.info(` Queue: ${config.SQS_QUEUE_URL}`);
|
|
255
255
|
logger.info(` Sessions table: ${config.SESSIONS_TABLE}`);
|
|
256
256
|
}
|
|
257
|
+
await logGitDiagnostics();
|
|
257
258
|
await ensureDirectories();
|
|
258
259
|
await ensureBaseBrain();
|
|
259
260
|
await pollLoop();
|