mirror of
https://github.com/n8n-io/n8n.git
synced 2026-10-17 05:29:44 +02:00
fix: Load Codespaces worker secrets before startup (no-changelog) (#37767)
This commit is contained in:
parent
ae26d9599d
commit
30d00cc61a
|
|
@ -68,6 +68,10 @@ same way as `ANTHROPIC_API_KEY`:
|
|||
- `OPENROUTER_API_KEY` — the model provider key for Sol.
|
||||
- `SLACK_BOT_TOKEN` — optional bot token for progress messages. It needs `chat:write` only.
|
||||
|
||||
The worker explicitly reloads `/usr/local/lib/codespaces-env.sh` when its tmux
|
||||
session starts. An existing tmux server can otherwise retain an environment
|
||||
that did not load the Codespaces secrets.
|
||||
|
||||
The dequeue payload can include `slack.channel` and `slack.thread_ts`. The
|
||||
worker posts one placeholder in that thread. It coalesces completed tool calls.
|
||||
It updates the message at most once every 1.5 seconds. It does not send reasoning
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import assert from 'node:assert/strict';
|
||||
import { EventEmitter } from 'node:events';
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { PassThrough } from 'node:stream';
|
||||
import { test } from 'node:test';
|
||||
import { setTimeout as sleep } from 'node:timers/promises';
|
||||
|
|
@ -11,6 +12,14 @@ const turn = {
|
|||
slack: { channel: 'C123', thread_ts: '123.456' },
|
||||
};
|
||||
|
||||
test('reloads Codespaces secrets before the worker starts', () => {
|
||||
const postStart = readFileSync(new URL('./post-start.mjs', import.meta.url), 'utf8');
|
||||
assert.match(
|
||||
postStart,
|
||||
/bash -lc "\. \/usr\/local\/lib\/codespaces-env\.sh; .*node \/workspaces\/n8n\/\.devcontainer\/codespaces\/agent-worker\.mjs/,
|
||||
);
|
||||
});
|
||||
|
||||
function slackRecorder() {
|
||||
const calls = [];
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -75,5 +75,5 @@ tryRun('worker start', 'tmux', [
|
|||
'-d',
|
||||
'-s',
|
||||
'agent-worker',
|
||||
'bash -lc "export CLAUDE_CODE_PLUGIN_PREFER_HTTPS=1 CLAUDE_CODE_PLUGIN_KEEP_MARKETPLACE_ON_FAILURE=1; node /workspaces/n8n/.devcontainer/codespaces/agent-worker.mjs >> /tmp/agent-worker.log 2>&1"',
|
||||
'bash -lc ". /usr/local/lib/codespaces-env.sh; export CLAUDE_CODE_PLUGIN_PREFER_HTTPS=1 CLAUDE_CODE_PLUGIN_KEEP_MARKETPLACE_ON_FAILURE=1; node /workspaces/n8n/.devcontainer/codespaces/agent-worker.mjs >> /tmp/agent-worker.log 2>&1"',
|
||||
]);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user