-
Notifications
You must be signed in to change notification settings - Fork 0
fix(core): omit credential-bearing workflow observer links #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,6 +47,7 @@ export function formatError(stepName: string, error: unknown): string { | |
| // Common secret patterns to redact from channel output. | ||
| const SECRET_PATTERNS = [ | ||
| /(?:api[_-]?key|apikey|secret[_-]?key|access[_-]?token|auth[_-]?token|bearer)\s*[:=]\s*\S+/gi, | ||
| /(?:rk_live_|at_live_|nt_live_|ot_live_|cld_at_|rth_at_|ocl_node_enr_|br_)[a-zA-Z0-9_%-]+(?:\.[a-zA-Z0-9_%-]+)*/g, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When step or forwarded channel output contains an ordinary identifier such as Useful? React with 👍 / 👎. |
||
| /(?:sk|pk|rk|ak)[-_][a-zA-Z0-9]{20,}/g, | ||
| /ghp_[a-zA-Z0-9]{36,}/g, | ||
| /gho_[a-zA-Z0-9]{36,}/g, | ||
|
|
@@ -97,6 +98,14 @@ export function scrubSecrets(text: string): string { | |
| return result; | ||
| } | ||
|
|
||
| export function formatObserverGuidance(channel: string): string[] { | ||
| return [ | ||
| 'Workspace created for this workflow.', | ||
| ' Observation: requires a separately provisioned, read-only observer token', | ||
| ` Channel: ${channel}`, | ||
| ]; | ||
| } | ||
|
|
||
| function stripMalformedPtyFrameGarbage(line: string): string { | ||
| const strippedRuns = line.replace(MALFORMED_PTY_FRAME_RUN_RE, ' '); | ||
| const compact = strippedRuns.replace(SPINNER_RE, '').replace(/\s+/g, ''); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -64,7 +64,11 @@ import { ensureRelayfileMount, type MountHandle } from '@relayfile/sdk/workspace | |
| import { collectCliSession, type CliSessionReport } from './cli-session-collector.js'; | ||
| import { executeApiStep } from './api-executor.js'; | ||
| import { BudgetExceededError, BudgetTracker } from './budget-tracker.js'; | ||
| import { ChannelMessenger, scrubForChannel as scrubWorkflowOutputForChannel } from './channel-messenger.js'; | ||
| import { | ||
| ChannelMessenger, | ||
| formatObserverGuidance, | ||
| scrubForChannel as scrubWorkflowOutputForChannel, | ||
| } from './channel-messenger.js'; | ||
| import { InMemoryWorkflowDb } from './memory-db.js'; | ||
| import { buildCommand as buildProcessCommand, spawnProcess } from './process-spawner.js'; | ||
| import { createProcessBackendExecutor } from './process-backend-executor.js'; | ||
|
|
@@ -3780,10 +3784,10 @@ export class WorkflowRunner { | |
| this.log('Resolving Relaycast API key...'); | ||
| await this.ensureRelaycastApiKey(channel); | ||
| this.log('API key resolved'); | ||
| if (this.relayApiKeyAutoCreated && this.relayApiKey) { | ||
| this.log(`Workspace created — follow this run in Relaycast:`); | ||
| this.log(` Observer: https://agentrelay.com/observer?key=${this.relayApiKey}`); | ||
| this.log(` Channel: ${channel}`); | ||
| if (this.relayApiKeyAutoCreated) { | ||
| for (const line of formatObserverGuidance(channel)) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: Auto-created workspace guidance disappears from CLI/Listr output when the workflow uses a configured channel such as Prompt for AI agents |
||
| this.log(line); | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Align the
brpattern and regression test with the required live prefix.The
br_alternative matchesbr_live_...only by prefix overlap. It also redacts unrelatedbr_...values. The test does not verify the requiredbr_live_...format.packages/core/src/channel-messenger.ts#L50-L50: usebr_live_; retainbr_only if it is a documented legacy format.packages/core/src/__tests__/channel-messenger.test.ts#L47-L60: addbr_live_0123456789abcdefas an exact regression case.📍 Affects 2 files
packages/core/src/channel-messenger.ts#L50-L50(this comment)packages/core/src/__tests__/channel-messenger.test.ts#L47-L60🤖 Prompt for AI Agents