MCPcopy Index your code
hub / github.com/Dimillian/CodexMonitor / isSubagentThreadSource

Function isSubagentThreadSource

src/features/threads/utils/threadRpc.ts:80–100  ·  view source on GitHub ↗
(source: unknown)

Source from the content-addressed store, hash-verified

78}
79
80export function isSubagentThreadSource(source: unknown): boolean {
81 if (typeof source === "string") {
82 const normalized = source.trim().toLowerCase();
83 return normalized.startsWith("subagent") || normalized.startsWith("sub_agent");
84 }
85
86 const sourceRecord = asRecord(source);
87 if (!sourceRecord) {
88 return false;
89 }
90
91 const subAgent =
92 sourceRecord.subAgent ?? sourceRecord.sub_agent ?? sourceRecord.subagent;
93 if (subAgent === null || subAgent === undefined) {
94 return false;
95 }
96 if (typeof subAgent === "string") {
97 return subAgent.trim().length > 0;
98 }
99 return typeof subAgent === "object";
100}
101
102export function shouldHideSubagentThreadFromSidebar(source: unknown): boolean {
103 const subagentKind = getSubagentKind(source);

Calls 1

asRecordFunction · 0.70

Tested by

no test coverage detected